Class Util
java.lang.Object
no.uib.jsparklines.renderers.util.Util
public class Util extends Object
Includes general helper methods that are used by the other classes.
- Author:
- Harald Barsnes
-
Constructor Summary
Constructors Constructor Description Util()
-
Method Summary
Modifier and Type Method Description static String
color2Hex(Color color)
Converts a color to hex format for use in HTML tags.static double
roundDouble(double d, int places)
Rounds a double value to the wanted number of decimal places.
-
Constructor Details
-
Util
public Util()
-
-
Method Details
-
roundDouble
public static double roundDouble(double d, int places)Rounds a double value to the wanted number of decimal places.- Parameters:
d
- the double to round ofplaces
- number of decimal places wanted- Returns:
- double - the new double
-
color2Hex
Converts a color to hex format for use in HTML tags.- Parameters:
color
- the color to convert- Returns:
- the color in hex format
-