Java Number Format Pattern createDecimalFormatter(String pattern)

Here you can find the source of createDecimalFormatter(String pattern)

Description

create Decimal Formatter

License

Open Source License

Declaration

private static DecimalFormat createDecimalFormatter(String pattern) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2018 Arrow Electronics, Inc.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Apache License 2.0
 * which accompanies this distribution, and is available at
 * http://apache.org/licenses/LICENSE-2.0
 *
 * Contributors:/*from w  ww .ja  v  a  2 s  .  c  om*/
 *     Arrow Electronics, Inc.
 *******************************************************************************/

import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.Locale;

public class Main {
    private static DecimalFormat createDecimalFormatter(String pattern) {
        DecimalFormat formatter = (DecimalFormat) NumberFormat.getCurrencyInstance(Locale.US);
        formatter.applyPattern(pattern);
        return formatter;
    }
}

Related

  1. countFormat(int no)
  2. createDecimalFormat(final String pattern)
  3. CreateDecimalFormat(int numberOfDecimalsDisplayed)
  4. createDecimalFormat(String pattern)
  5. createNumberFormat()
  6. createNumberFormat(int cnt)
  7. createOrderVolumeNumberFormat()
  8. createRealFormat()