Here you can find the source of money2String(double money)
public static String money2String(double money)
//package com.java2s; public class Main { public static String money2String(double money) { String[] amounts = (String.format("%.2f", money)).split("\\."); String amount = ""; for (String a : amounts) { amount += a;//from w ww . j a va 2 s.c om } return String.format("%012d", Long.valueOf(amount)); } }