All Downloads are FREE. Search and download functionalities are using the official Maven repository.

eu.hansolo.steelseries.tools.NumberFormat Maven / Gradle / Ivy

Go to download

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.

There is a newer version: 3.9.30
Show newest version
/*
 */
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);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy