Java Money string2Money(String money)

Here you can find the source of string2Money(String money)

Description

string Money

License

Open Source License

Declaration

public static String string2Money(String money) 

Method Source Code

//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;
        }
    }
}

Related

  1. isMoney(String[] Moneys, String key)
  2. moneyChange(String money)
  3. moneyFenToYuan(String amount)
  4. moneyMinus(float a, float b)
  5. multiMoney(Integer money)
  6. translateMoneyStr(String money)