|
@@ -1255,7 +1255,7 @@ func changePointDecimalPlaces(str string, changeNum int, numberType string, isPe
|
|
|
} else if decimalPlaces == 1 {
|
|
|
decimalPlaces += 1
|
|
|
} else if decimalPlaces == 0 {
|
|
|
- if len(str) == 1 {
|
|
|
+ if len(str) == 1 || len(str) > 2 {
|
|
|
decimalPlaces = 2
|
|
|
} else if len(str) == 2 {
|
|
|
if str[1] == '0' {
|
|
@@ -1269,7 +1269,7 @@ func changePointDecimalPlaces(str string, changeNum int, numberType string, isPe
|
|
|
}
|
|
|
} else {
|
|
|
if numberType == "percent" {
|
|
|
- if decimalPlaces > 2 {
|
|
|
+ if decimalPlaces >= 2 {
|
|
|
decimalPlaces -= 2
|
|
|
} else if decimalPlaces == 1 {
|
|
|
decimalPlaces = 0
|