Here you can find the source of getUSNumberFormatter()
public static NumberFormat getUSNumberFormatter()
//package com.java2s; //License from project: Open Source License import java.text.NumberFormat; import java.util.Locale; public class Main { public static NumberFormat getUSNumberFormatter() { NumberFormat nf = NumberFormat.getInstance(Locale.US); return setFloatDigits(nf); }// ww w .j ava 2s. co m private static NumberFormat setFloatDigits(NumberFormat nf) { nf.setMaximumFractionDigits(2); nf.setMinimumFractionDigits(2); nf.setGroupingUsed(false); return nf; } }