Here you can find the source of numberFormat(String pattern, double value)
Parameter | Description |
---|---|
pattern | a parameter |
value | a parameter |
public static String numberFormat(String pattern, double value)
//package com.java2s; //License from project: Open Source License import java.text.DecimalFormat; public class Main { /**//from ww w . j ava 2 s.c o m * Returns an text with the value formatted. The possible pattern are: * * @param pattern * @param value * @return */ public static String numberFormat(String pattern, double value) { DecimalFormat myFormatter = new DecimalFormat(pattern); return myFormatter.format(value); } }