|
@@ -208,11 +208,11 @@ func capitalMoney(data []interface{}) []interface{} {
|
|
if len(strmatch) > 0 {
|
|
if len(strmatch) > 0 {
|
|
str = strmatch[0][0]
|
|
str = strmatch[0][0]
|
|
}
|
|
}
|
|
- //修正单位类似:捌万伍仟肆佰捌拾贰万元整
|
|
|
|
- if strings.Contains(str, "万元") {
|
|
|
|
- str = strings.Replace(str, "万元", "#B#", -1)
|
|
|
|
- str = strings.Replace(str, "万", "亿", -1)
|
|
|
|
- str = strings.Replace(str, "#B#", "万元", -1)
|
|
|
|
|
|
+ suffixUnit := float64(1)
|
|
|
|
+ if strings.HasSuffix(str, "万") || strings.HasSuffix(str, "万元") || strings.HasSuffix(str, "万元整") {
|
|
|
|
+ index := strings.LastIndex(str, "万")
|
|
|
|
+ str = str[0:index]
|
|
|
|
+ suffixUnit = float64(10000)
|
|
}
|
|
}
|
|
moneyRegChar.ReplaceAllStringFunc(str, func(key string) string {
|
|
moneyRegChar.ReplaceAllStringFunc(str, func(key string) string {
|
|
if key == "元" || key == "圆" || key == "点" {
|
|
if key == "元" || key == "圆" || key == "点" {
|
|
@@ -262,7 +262,7 @@ func capitalMoney(data []interface{}) []interface{} {
|
|
for _, v := range nodes {
|
|
for _, v := range nodes {
|
|
ret += v
|
|
ret += v
|
|
}
|
|
}
|
|
- return []interface{}{ret + decimals, data[1]}
|
|
|
|
|
|
+ return []interface{}{(ret + decimals) * suffixUnit, data[1]}
|
|
}
|
|
}
|
|
|
|
|
|
//过滤符号
|
|
//过滤符号
|