Here you can find the source of toMoney(long amount)
public static String toMoney(long amount)
//package com.java2s; //License from project: Apache License import java.text.DecimalFormat; public class Main { public static String toMoney(long amount) { DecimalFormat df = new DecimalFormat("00"); long bigPart = amount / 100; long smallPart = amount % 100; String result = String.format("%d.%s", bigPart, df.format(smallPart));//from www.j av a2 s. co m return result; } }