Here you can find the source of convertToMoney(float money)
public static String convertToMoney(float money)
//package com.java2s; import java.math.BigDecimal; public class Main { public static String convertToMoney(float money) { BigDecimal objB = new BigDecimal(Double.toString(money)); return objB.divide(BigDecimal.ONE, 2, BigDecimal.ROUND_HALF_UP).toString(); }//from www .j a va 2s . c o m }