This commit is contained in:
laodaming 2023-09-27 16:09:28 +08:00
parent e917792988
commit 142ada5b07

View File

@ -1,7 +1,7 @@
package format
import (
"log"
"github.com/zeromicro/go-zero/core/logx"
"strconv"
"strings"
)
@ -10,7 +10,7 @@ import (
func NumToStringWithThousandthPercentile(numberStr string) string {
numberStr = strings.TrimLeft(numberStr, "0") //去掉左边开始的0
if _, err := strconv.ParseFloat(numberStr, 64); err != nil {
log.Fatalln("is not a number")
logx.Error("is not a number")
return ""
}
sliceList := strings.Split(numberStr, ".") //切分开小数