人民币转换大写

1、

public class RenMinBi {
    //数字
    private static final char[] data = new char[] {'零', '壹', '贰', '叁', '肆',
        '伍', '陆', '柒', '捌', '玖'};
    //单位
    private static final char[] units = new char[] {'元', '拾', '佰', '仟', '万',
        '拾', '佰', '仟', '亿'};
     static int count = 0;
    
    public String change(String str) {
        StringBuffer sb = new StringBuffer();
        String moneystr = str.substring(1);
        Integer money = Integer.parseInt(moneystr);
        while (money!=0) {
            int yushu = money%10;
            sb.insert(0,units[count++]);
            sb.insert(0, data[yushu]);
            money = money/10;
        }
        return sb.toString();
    }
}
原文地址:https://www.cnblogs.com/h-g-f-s123/p/6434646.html