Java Fraction Format formatAmount(double number)

Here you can find the source of formatAmount(double number)

Description

Creates a formatted string from the number input.

License

Open Source License

Parameter

Parameter Description

Return

a formatted number to be put on display for the user

Declaration

public static String formatAmount(double number) 

Method Source Code

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

import java.text.NumberFormat;

public class Main {
    /**// w w w .  j a  v  a 2 s .  co  m
      * Creates a formatted string from the number input.
      * 
      * @param double number to convert
      * @return a formatted number to be put on display for the user
      */
    public static String formatAmount(double number) {
        NumberFormat numberFormatter = NumberFormat.getCurrencyInstance();
        String formattedString = numberFormatter.format(number);
        return formattedString;
    }
}

Related

  1. format(NumberFormat nf, float number, float defaultValue)
  2. format0(Double d)
  3. format2Double(Double amount)
  4. formatAmount(double amount)
  5. formatAmount(Double amount)
  6. formatAmount(final double mark)
  7. formatAnotherString(double valor)
  8. formataNum(double numero)
  9. formatAvgTime(double avg)