Java Locale Format formataValor(Double valor)

Here you can find the source of formataValor(Double valor)

Description

formata Valor

License

Open Source License

Declaration

public static String formataValor(Double valor) 

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 final String LOCALE_LANGUAGE = "pt";
    public static final String LOCALE_COUNTRY = "BR";

    public static String formataValor(Double valor) {
        NumberFormat nf = NumberFormat.getInstance(new Locale(LOCALE_LANGUAGE, LOCALE_COUNTRY));
        nf.setMinimumFractionDigits(2);/* w  w w. j a v  a2  s . c om*/
        nf.setMaximumFractionDigits(2);
        nf.setMinimumIntegerDigits(1);
        return nf.format(valor);
    }
}

Related

  1. format12(final long ticks)
  2. formatAdena(long amount)
  3. formatAdena(long amount)
  4. formatarDataArquivoStr(String data)
  5. formatarNumeroBr(Double numero)
  6. formatBytes(final long bytes)
  7. formatBytes(long byteCount, Locale locale)
  8. formatBytesForDisplay(long amount)
  9. formatComma(String number)