Here you can find the source of doubleFormat(double number)
Parameter | Description |
---|---|
number | The number to format |
public static String doubleFormat(double number)
//package com.java2s; //License from project: Open Source License import java.text.NumberFormat; import java.util.Locale; public class Main { /**/*from ww w .j av a 2s . co m*/ * A number formatted in a String * * @param number The number to format * * @return The formatted number */ public static String doubleFormat(double number) { NumberFormat nf_out = NumberFormat.getNumberInstance(Locale.UK); nf_out.setMaximumFractionDigits(2); return nf_out.format(number); } }