Here you can find the source of string2Money(String money)
public static String string2Money(String money)
//package com.java2s; public class Main { public static String string2Money(String money) { if (money.matches("[0-9]{12,}")) { money = money.substring(0, money.length() - 2) + "." + money.substring(money.length() - 2); return money.replaceAll("^0+(?!$)", ""); } else {//from w ww. jav a 2 s . c o m return null; } } }