public class ChineseNumberParser extends Object
Constructor and Description |
---|
ChineseNumberParser() |
Modifier and Type | Method and Description |
---|---|
static BigDecimal |
parseFromChinese(String chinese)
把中文转换为数字 如 二百二十 -》 220
一百一十二 -》 112 一千零一十二 -》 1012 |
static BigDecimal |
parseFromChineseMoney(String chineseMoneyAmount)
中文大写数字金额转换为数字,返回结果以元为单位的BigDecimal类型数字
如: “陆万柒仟伍佰伍拾陆元叁角贰分”返回“67556.32” “叁角贰分”返回“0.32” |
static BigDecimal |
parseFromChineseNumber(String chinese)
把中文转换为数字
一百一十二 -》 112 一千零一十二 -》 1012 十二点二三 -》 12.23 三点一四一五九二六五四 -》 3.141592654 |
static long |
parseLongFromChineseNumber(char[] chinese,
int beginIndex,
int toIndex)
把中文整数转换为数字 如 二百二十 220
一百一十二 -》 112 一千零一十二 -》 1012 |
public static BigDecimal parseFromChinese(String chinese)
chinese
- 中文字符public static BigDecimal parseFromChineseNumber(String chinese)
chinese
- 中文字符public static BigDecimal parseFromChineseMoney(String chineseMoneyAmount)
chineseMoneyAmount
- 中文大写数字金额public static long parseLongFromChineseNumber(char[] chinese, int beginIndex, int toIndex)
chinese
- 中文字符beginIndex
- 起始位置toIndex
- 结束位置(不包括),如果提供的是整数,这个为length(),小数则是“点”的位置Copyright © 2025. All rights reserved.