eu.hansolo.steelseries.tools.NumberFormat Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of SteelSeries Show documentation
Show all versions of SteelSeries Show documentation
The SteelSeries is a javabeans component library that contains gauges.
You will find linear and radial gauges. In addition you will also find
digital displays, indicators from cars and some instruments from airplanes and
sailboats.
/*
*/
package eu.hansolo.steelseries.tools;
import java.text.DecimalFormat;
/**
* @author Gerrit Grunwald
*/
public enum NumberFormat {
AUTO("0"),
STANDARD("0"),
FRACTIONAL("0.0#"),
SCIENTIFIC("0.##E0"),
PERCENTAGE("##0.0%");
private final DecimalFormat DF;
private NumberFormat(final String FORMAT_STRING) {
DF = new DecimalFormat(FORMAT_STRING);
}
public String format(final Number NUMBER) {
return DF.format(NUMBER);
}
}