Code example for NumberFormat

Methods: setMaximumFractionDigitssetMaximumIntegerDigits

0
 
    private static final NumberFormat format;
 
    static { 
        format = new DecimalFormat();
        format.setMaximumFractionDigits(1);
        format.setMaximumIntegerDigits(3);
    } 
 
    private int hitCount;
    private int missCount;
 
    public void hit() { 
        hitCount++;
    } 
 
    public void miss() { 
        missCount++;
    } 
 
Stop searching for code, let great code find you!  Add Codota to your java IDE