Here you can find the source of formatAmount(double number)
Parameter | Description |
---|
public static String formatAmount(double number)
//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; } }