Java Currency Format toCurrencyFormat(String input)

Here you can find the source of toCurrencyFormat(String input)

Description

to Currency Format

License

Open Source License

Declaration

public static String toCurrencyFormat(String input) 

Method Source Code

//package com.java2s;

import java.text.*;

public class Main {

    public static String toCurrencyFormat(String input) {

        if (input.indexOf(".") != -1)
            return NumberFormat.getCurrencyInstance().format((new java.lang.Double(input)).doubleValue());
        else {/*from ww  w . ja va 2s  .  com*/
            return NumberFormat.getCurrencyInstance().format((new java.lang.Long(input)).longValue());
        }
    }
}

Related

  1. parseCurrency(String currency)
  2. removeTrailingZeroes(BigDecimal value, boolean isCurrency)
  3. roundToCurrencyString(double amount)
  4. toCurrency(Object objectValue)
  5. toCurrencyAmountStr(Long microAmount)
  6. toCurrencyFormat(String pattern, double value)
  7. toCurrencyWord(Double doubleValue, Locale locale)