Java Decimal Format toFixedString(Locale locale, double value, int precision)

Here you can find the source of toFixedString(Locale locale, double value, int precision)

Description

to Fixed String

License

Open Source License

Declaration

public static String toFixedString(Locale locale, double value, int precision) 

Method Source Code

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

import java.text.NumberFormat;

import java.util.Locale;

public class Main {
    public static String toFixedString(Locale locale, double value, int precision) {
        NumberFormat nf = NumberFormat.getInstance(locale);
        int current = nf.getMaximumFractionDigits();
        nf.setMaximumFractionDigits(precision);
        String ans = nf.format(value);
        nf.setMaximumFractionDigits(current);
        return ans;
    }//from www .  j av a 2s . com
}

Related

  1. toDouble(String text)
  2. toDoubleObject(Object o)
  3. toDoubOriginOutPut(double d, int digitally)
  4. toEdmDouble(double value)
  5. toFix(double x, int dp)
  6. toFmtDoubleStr(String doubleStr)
  7. toParse(double d)
  8. toPrecision(double I, int digits1, int digits2)
  9. toScientific(double I, int digits)