数字转中文数字(123–>“壹佰贰拾叁”、“一百二十三”)
直接上代码,注释完整,各位网友如有其它好的方案,麻烦留言探讨,万分感谢!
package fun.chice.xxx;
/**
* 数字转中文数字工具
* Created by Chice on 2018/9/5.
* Email:2206143885@qq.com
* CSDN:http://blog.csdn.net/chicet
*/
public final class NumToChineseLetterFormatter {
private static final String CHINESE_NUM_FLAG_NEGATIVE = "负";
private static final String CHINESE_NUM_FLAG_ZERO = "零";
private static final String CHINESE_NUM_FLAG_DOUBLE_ZERO = "零零";
private static final String CHINESE_NUM_FLAG_WAN = "万";
private static final String CHINESE_NUM_FLAG_YI = "亿";
private static final String CHINESE_NUM_FLAG_ZHAO = "兆";// 此数位存在争议,暂用“亿亿为兆”的方案
private static final String[] CHINESE_NUM_UNIT = {
"", "十", "百", "千"};
private static final St