Java Fraction Format formatOneDp(double inNumber)

Here you can find the source of formatOneDp(double inNumber)

Description

format One Dp

License

Open Source License

Parameter

Parameter Description
inNumber number to format

Return

formatted number to one decimal place

Declaration

public static String formatOneDp(double inNumber) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.text.NumberFormat;

public class Main {
    /** Number formatter for one decimal place */
    private static final NumberFormat FORMAT_ONE_DP = NumberFormat.getNumberInstance();

    /**//w ww .  j  a  va 2  s.com
     * @param inNumber number to format
     * @return formatted number to one decimal place
     */
    public static String formatOneDp(double inNumber) {
        return FORMAT_ONE_DP.format(inNumber);
    }
}

Related

  1. formatNumFraction(float num, int unit)
  2. formatNumValueWithComma(double val)
  3. formatoDecimal(String tipo, double valor)
  4. formatOLETime(double oleTime)
  5. formatOneDecimal(double dNumber)
  6. formatPair(double in, double out)
  7. formatPotencia(float potencia)
  8. formatPowerFloat(float averageRfTickSent)
  9. formatPrice(Double price)