求此图个按键的面包王金卓求中文版释义

JAVA如何把键盘输入的金额换转成中文显示。在线求解释~~~_百度知道
JAVA如何把键盘输入的金额换转成中文显示。在线求解释~~~
比输入:1234.12显示
壹千贰百叁十肆块壹角贰
类似于发票汉字显示
提问者采纳
/**&*&10亿内阿拉伯数字转汉字写形式&*&@author&Hp&*&&*/public&class&TestNum&{&&//&整数部&&private&String&integerP&&//&数部&&private&String&floatP&&&&//&数字转化汉字数组,各实例都要使用所设静态&&private&static&final&char[]&cnNumbers={'零','壹','贰','叁','肆','伍','陆','柒','捌','玖'};&&&&//&供级转化数组,各实例都要使用所设静态&&private&static&final&char[]&series={'元','拾','百','仟','万','拾','百','仟','亿'};&&&&/**&&&*&构造函数,通阿拉伯数字形式字符串传入&&&*&@param&original&&&*/&&public&TestNum(String&original){&&&&&//&员变量初始化&&&&integerPart=&&;&&&&floatPart=&&;&&&&&&&&if(original.contains(&.&)){&&&&&&//&包含数点&&&&&&int&dotIndex=original.indexOf(&.&);&&&&&&integerPart=original.substring(0,dotIndex);&&&&&&floatPart=original.substring(dotIndex+1);&&&&}&&&&else{&&&&&&//&包含数点&&&&&&integerPart=&&&&}&&}&&&&/**&&&*&取写形式字符串&&&*&@return&&&*/&&public&String&getCnString(){&&&&//&累加所用StringBuffer&&&&StringBuffer&sb=new&StringBuffer();&&&&&&&&//&整数部处理&&&&for(int&i=0;i&integerPart.length();i++){&&&&&&int&number=getNumber(integerPart.charAt(i));&&&&&&&&&&&&sb.append(cnNumbers[number]);&&&&&&sb.append(series[integerPart.length()-1-i]);&&&&}&&&&&&&&//&数部处理&&&&if(floatPart.length()&0){&&&&&&sb.append(&点&);&&&&&&for(int&i=0;i&floatPart.length();i++){&&&&&&&&int&number=getNumber(floatPart.charAt(i));&&&&&&&&&&&&&&&&sb.append(cnNumbers[number]);&&&&&&}&&&&}&&&&&&&&//&返拼接字符串&&&&return&sb.toString();&&}&&&&/**&&&*&字符形式数字转化整形数字&&&*&所实例都要用所用静态修饰&&&*&@param&c&&&*&@return&&&*/&&private&static&int&getNumber(char&c){&&&&String&str=String.valueOf(c);&&&&&&&return&Integer.parseInt(str);&&}&&&&/**&&&*&@param&args&&&*/&&public&static&void&main(String[]&args)&{&&&&System.out.println(new&TestNum(&345&).getCnString());&&&&System.out.println(new&TestNum(&&).getCnString());&&&&System.out.println(new&TestNum(&.&).getCnString());&&&&System.out.println(new&TestNum(&0.1234&).getCnString());&&&&System.out.println(new&TestNum(&1&).getCnString());&&&&System.out.println(new&TestNum(&12&).getCnString());&&&&System.out.println(new&TestNum(&123&).getCnString());&&&&System.out.println(new&TestNum(&1234&).getCnString());&&&&System.out.println(new&TestNum(&12345&).getCnString());&&&&System.out.println(new&TestNum(&123456&).getCnString());&&&&System.out.println(new&TestNum(&1234567&).getCnString());&&&&System.out.println(new&TestNum(&&).getCnString());&&&&System.out.println(new&TestNum(&&).getCnString());&&}}
提问者评价
其他类似问题
键盘输入的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁最近几天进空电梯准备下楼,发现1楼的按键灯已经亮了。以前也坐同一个电梯,从来没出过这种事,求解释!_百度知道
最近几天进空电梯准备下楼,发现1楼的按键灯已经亮了。以前也坐同一个电梯,从来没出过这种事,求解释!
近几进空电梯准备楼发现1楼按键灯已经亮前坐同电梯没种事求解释(请要牵扯灵异求科行解释)
找保安原键盘接触良换谢答
提问者采纳
我经干种事比我<img class="word-replace" src="/api/getdecpic?picenc=0a007a楼电梯电梯门候再电梯按1楼看自并且乐疲我看电视说压力能遇我
那也说不定吧………只是我觉得很多天连续碰上太巧了一点吧
而且诶最近炮仗这么多,喜气都连天了,连年兽都不敢出来,区区小鬼~
连续遇上,这就更是对了,说明那个人起得比你早啊,说明就是存在这个人
提问者评价
已经知道怎么回事了,谢谢
其他类似问题
按默认排序
其他2条回答
能按楼却其楼层
但已经连续很多次了……
好可怕……一般电梯就算自动到1楼,灯是不会亮的
已经知道怎么回事了,谢谢
怎么回事?我很好奇
按键键盘接触不良,有时候松动了按不起,有时候不按就有楼层自动亮,一楼是被按得最多的,所以最早出问题,就成了现在这样。
有可能是一楼灯坏了
已经知道怎么回事了,谢谢
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁如果您看到这个提示,说明QQ空间无法正常打开,请尝试计算机系统使用多种输入设备。其中有些输入设备直接进行人-机通信,另一些则首先要求把数据记录在诸如磁性材料那样的输入介质上。常用的是读取以磁化方式记录在专门涂敷的塑料带或软盘上的数据的输入设备。直接输入设备有与计算机的工作站直接连接或在线连接的键盘,以及鼠标器、输入器、触摸式屏幕和话筒等。不论使用哪种设备,所有这些都是人与计算机系统之间的解释和通信的部件。的翻译:Computer systems using a variety of input devices. Some input device directly to man-machine communication, others first requested records data such as magnetic materials as input media. Common magnetic record is read in specially-coated plastic tape or floppy disk data input devices. Direct input d 什么意思?中文翻译英文,英文翻译中文,怎么说?
青云英语翻译
计算机系统使用多种输入设备。其中有些输入设备直接进行人-机通信,另一些则首先要求把数据记录在诸如磁性材料那样的输入介质上。常用的是读取以磁化方式记录在专门涂敷的塑料带或软盘上的数据的输入设备。直接输入设备有与计算机的工作站直接连接或在线连接的键盘,以及鼠标器、输入器、触摸式屏幕和话筒等。不论使用哪种设备,所有这些都是人与计算机系统之间的解释和通信的部件。
选择语言:从
罗马尼亚语
罗马尼亚语
The computer system uses a variety of input devices. Some input device directly to the man - machine communication, while others are first asked to record data such as magnetic materials as input media. Commonly used to read the records to magnetization data input devices on the specially coated pla
Computer systems using a variety of input devices. Some input device directly to man-machine communication, others first requested records data such as magnetic materials as input media. Common magnetic record is read in specially-coated plastic tape or floppy disk data input devices. Direct input d
正在翻译,请等待...
正在翻译,请等待...
Computer systems using a variety of input devices. Some input device directly to man-machine communication, others first requested records data such as magnetic materials as input media. Common magnetic record is read in specially-coated plastic tape or floppy disk data input devices. Direct input d

我要回帖

更多关于 面包王金卓求中文版 的文章

 

随机推荐