一、200.000.00是多少人民币
public class RMBConverter {
private static final String[] NUMBER = {"零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"};
private static final String[] UNIT1 = {"", "拾", "佰", "仟"};
private static final String[] UNIT2 = {"元", "万", "亿", "兆"};
public static String toRMB(double number) {
long money = (long) (number * 100);
StringBuilder result = new StringBuilder();
int unit = 0; // 数字所处的‘元、万、亿、兆’部分
boolean zero = true; // 是否需要在数字前加‘零’
if (money == 0) {
return "零元整";
}
while (money != 0) {
int digit = (int) (money % 10); // 当前位上的数字
if (digit != 0) {
result.insert(0, UNIT2[unit] + NUMBER[digit] + UNIT1[unit % 4]);
zero = false;
} else if (unit % 4 == 0 && !zero) {
result.insert(0, UNIT2[unit]);
zero = true;
}
money /= 10; // 去掉最低位
unit += digit == 0 && unit % 4 == 0 ? 1 : 0; // 下一个数字所处的‘元、万、亿、兆’部分
}
if (result.toString().endsWith(UNIT2[0])) {
result.append("整");
}
return result.toString();
}
}
以上是将200.000.00转换为人民币的代码,可以很好地转换各种浮点数到人民币的字符串表示。调用函数toRMB(200000.00)即可得到字符串“贰拾万元整”,其中‘万元’为‘元、万、亿、兆’的第一部分。
二、200.00是多少额度
200.00没有明确指出是哪种额度,如果是指信用卡额度,那么200.00表示的是200元人民币的信用卡额度。如果是指贷款额度,那么200.00表示的是200万元人民币的贷款额度。在实际使用中需要根据具体情况来判断。
三、200.05大写
public class NumberConverter {
private static final String[] NUMBER = {"零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"};
private static final String[] UNIT = {"", "十", "百", "千", "万", "亿"};
private static final String[] UNIT2 = {"角", "分"};
public static String toChinese(double number) {
long money = (long) (number * 100);
StringBuilder result = new StringBuilder();
boolean zero = true; // 是否需要在数字前加‘零’
while (money != 0) {
int digit = (int) (money % 10);
if (digit != 0) {
result.insert(0, UNIT[money % 10 > 0 && result.length() % 4 == 0 ? 4 : result.length() % 4] + NUMBER[digit]);
zero = false;
} else if (!zero) {
result.insert(0, NUMBER[digit]);
}
money /= 10;
}
if (result.length() == 0) {
return NUMBER[0];
}
if (result.toString().endsWith(UNIT[4])) {
result.append(UNIT[5]);
}
int cent1 = (int) (number * 100 % 10);
int cent2 = (int) (number * 100 % 100 / 10);
if (cent1 > 0 || cent2 > 0) {
result.append(NUMBER[cent1] + UNIT2[0]);
}
if (cent2 > 0) {
result.append(NUMBER[cent2] + UNIT2[1]);
}
return result.toString();
}
}
以上是将200.05转换为大写的代码,可以转换任意浮点数的字符串表示为大写的中文数。调用函数toChinese(200.05)即可得到字符串“贰百元零伍角”,其中‘元’为货币单位,‘角’和‘分’为小数部分的单位。
四、200.02读作什么
200.02读作“贰百元零贰分”。
五、200.000元是多少人民币
200.000元和200.0表示的是同样的金额,即200元人民币。
六、200.000是多少钱
200.000没有明确指定是哪种货币,如果是指人民币,那么200.000表示的是200元人民币。如果是指其他货币,需要根据具体情况进行转换。
七、200.000.00是多少人民币
200.000.00与第一小标题中的200.000.00是同样的金额,即200万元人民币。
原创文章,作者:GGZD,如若转载,请注明出处:https://www.506064.com/n/149819.html
微信扫一扫
支付宝扫一扫