- public class Test10 {
- private static final char[] data = new char[]{
- '零','壹','贰','叁','肆','伍','陆','柒','捌','玖'
- };
- private static final char[] units = new char[]{
- '元','拾','佰','仟','万','拾','佰','仟','亿'
- };
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- System.out.println(convert(1080805));
- }
- public static String convert(int money)
- {
- StringBuffer sbf = new StringBuffer();
- int unit = 0;
- for(char i:(money+"").toCharArray()){
- sbf.append(data[i]);
- }
- return sbf.toString();
- }
- }
复制代码 |