Java tutorial
//package com.java2s; //License from project: Apache License import java.math.BigDecimal; public class Main { public static BigDecimal formatToYuan(String money) throws NumberFormatException { if (money.equals("")) { return new BigDecimal(0); } long m = Long.parseLong(money); return BigDecimal.valueOf(m); } }