|
|
@@ -199,7 +199,7 @@
|
|
|
let inputStr = num.toString()
|
|
|
let arr = inputStr.split('.')
|
|
|
let floatNum = arr[1]
|
|
|
- if (floatNum) {
|
|
|
+ if (floatNum && arr[0]) {
|
|
|
if (floatNum.length > 2) {
|
|
|
num = inputStr.substring(0, arr[0].length + 3)
|
|
|
if (Number(floatNum.charAt(2)) >= 1) {
|
|
|
@@ -210,7 +210,7 @@
|
|
|
if (num.toString().indexOf('.') === -1) {
|
|
|
num += '.00'
|
|
|
}
|
|
|
- if (floatNum1.length === 1) {
|
|
|
+ if (floatNum1 && floatNum1.length === 1) {
|
|
|
num = num + '0'
|
|
|
}
|
|
|
}
|
|
|
@@ -234,7 +234,7 @@
|
|
|
let inputStr = num.toString()
|
|
|
let arr = inputStr.split('.')
|
|
|
let floatNum = arr[1]
|
|
|
- if (floatNum) {
|
|
|
+ if (floatNum && arr[0]) {
|
|
|
if (floatNum.length > 6) {
|
|
|
num = inputStr.substring(0, arr[0].length + 7)
|
|
|
if (Number(floatNum.charAt(6)) > 4) {
|