Java Fraction Format formatNum(float value)

Here you can find the source of formatNum(float value)

Description

format Num

License

LGPL

Declaration

public static float formatNum(float value) 

Method Source Code


//package com.java2s;
//License from project: LGPL 

import java.text.DecimalFormat;

public class Main {
    public static float formatNum(float value) {
        DecimalFormat df1 = new DecimalFormat("###.00");
        return Float.parseFloat(df1.format(value));
    }/*from   ww  w.j  a  v  a2s.co m*/
}

Related

  1. formatMetricsDecimal(double value)
  2. formatNoGrouping(double value)
  3. formatNormalDouble(double value)
  4. formatNum(double d)
  5. formatNum(double num, int numfracdigits)
  6. formatNumber(double decimal)
  7. formatNumber(double i)
  8. formatNumber(double num)
  9. formatNumber(double num)