Java Number Format Pattern getUSNumberFormatter()

Here you can find the source of getUSNumberFormatter()

Description

get US Number Formatter

License

Open Source License

Declaration

public static NumberFormat getUSNumberFormatter() 

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 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;
    }
}

Related

  1. getScientificFormatter(int precision)
  2. getSeparator(final NumberFormat format)
  3. getStrFormatTwoPoint(float param)
  4. getTeamIDFormat()
  5. getUiNumberFormat()
  6. getValueFormatted(String name, String value)
  7. getValueFormatter()
  8. getZeroDecimalFormat()
  9. isDecimalFormat(DecimalFormat decimalFormat)