Java Number Format Pattern getFormatter()

Here you can find the source of getFormatter()

Description

get Formatter

License

Open Source License

Declaration

private static DecimalFormat getFormatter() 

Method Source Code


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

import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;

public class Main {
    private static DecimalFormat formatter = null;

    private static DecimalFormat getFormatter() {
        if (formatter == null) {
            DecimalFormat lFormatter = new DecimalFormat("#,###.###");
            DecimalFormatSymbols smb = new DecimalFormatSymbols();
            smb.setGroupingSeparator(' ');
            lFormatter.setDecimalFormatSymbols(smb);
            formatter = lFormatter;//from   w  ww  .  j a v  a  2  s . c o m
        }
        return formatter;
    }
}

Related

  1. getFormattedNumber(NumberFormat numberFormat, String fieldValue, Class valueClass)
  2. getFormattedNumber(String input)
  3. getFormattedQuantity(String qty, int len, String pad)
  4. getFormattedString4Digits(String number, String pattern)
  5. getFormatter()
  6. getFormatter(int precision)
  7. getFormatter(String pattern)
  8. getFormatTwoPoint(float param)
  9. getFormatWithMinimumDecimals(final int minimumDecimals, final int maximumDecimals)