posts - 5,  comments - 1,  trackbacks - 0

          static String t1 = "零壹貳叁肆伍陸柒捌玖";

          static char[] n = { '仟', ' ', '拾', '佰' };

          static char[] n1 = {'萬','億'};

          static char end = '圓';


          public static void print(String value, int pos, boolean b) {
          if (pos == 0) {
          System.out.print(end);
          return;
          }
          String value2 = value.substring(1, value.length());
          int printPos = value.charAt(0) - '0';
          if (printPos != 0) {
          if (b == true)
          System.out.print(t1.charAt(0));
          System.out.print(t1.charAt(printPos));
          System.out.print(printPos == 0 ? "" : (n[pos % 4] == ' ' ? "": n[pos % 4]));
          }
          if (pos % 4 == 1 && pos > 1) {
          System.out.print(n1[(pos / 4) - 1]);
          print(value2, pos - 1,? false);
          return;
          }
          print(value2, pos - 1, printPos == 0 ? true : false);
          }

          使用方法
          print("10010202070", 11, false);
          還沒看懂留著慢慢看。。。
          哪位高手給添點(diǎn)注釋,感激不盡。。。。

          posted on 2007-01-21 01:04 阿健 閱讀(459) 評論(0)  編輯  收藏 所屬分類: java
          <2007年1月>
          31123456
          78910111213
          14151617181920
          21222324252627
          28293031123
          45678910

          常用鏈接

          留言簿(2)

          隨筆分類

          隨筆檔案

          相冊

          BLOG

          Web Site

          搜索

          •  

          最新評論

          • 1.?re: 《大腕》IT版
          • 頂一下! 不錯(cuò)! 框架越多越好, 您要是只整了個(gè) Struts, 您都不要意思跟人說您是做 Java 的!
          • --BeanSoft

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 景宁| 新巴尔虎右旗| 新晃| 河津市| 南部县| 平邑县| 江孜县| 霍城县| 闻喜县| 望江县| 蒙阴县| 湖口县| 静乐县| 疏勒县| 青铜峡市| 收藏| 友谊县| 曲周县| 伊吾县| 安义县| 博野县| 仁寿县| 丰城市| 临洮县| 东平县| 兴义市| 通化县| 甘泉县| 无棣县| 隆昌县| 宿松县| 盐亭县| 夏河县| 台南县| 和林格尔县| 南漳县| 武宣县| 平乐县| 独山县| 元阳县| 宁明县|