Here you can find the source of roundToCurrencyString(double amount)
public static String roundToCurrencyString(double amount)
//package com.java2s; //License from project: Apache License import java.text.NumberFormat; public class Main { public static String roundToCurrencyString(double amount) { NumberFormat myFormatter = NumberFormat.getNumberInstance(); myFormatter.setMinimumFractionDigits(2); myFormatter.setMaximumFractionDigits(2); myFormatter.setGroupingUsed(false); return myFormatter.format(amount); }/* w ww .j a v a 2s .c o m*/ }