- fix bug in SplitSkuName.
This commit is contained in:
@@ -156,11 +156,18 @@ func CallMsgHandlerAsync(handler func(), primaryID string) {
|
||||
}
|
||||
|
||||
func SplitSkuName(fullName string) (name string, unit string) {
|
||||
unit = "份"
|
||||
index := strings.Index(fullName, "/")
|
||||
if index >= 0 {
|
||||
return fullName[:index], fullName[index+1:]
|
||||
name = fullName[:index]
|
||||
unitTmp := []rune(fullName[index+1:])
|
||||
if len(unitTmp) >= 1 {
|
||||
unit = string(unitTmp[:1])
|
||||
}
|
||||
} else {
|
||||
name = fullName
|
||||
}
|
||||
return fullName, "份"
|
||||
return name, unit
|
||||
}
|
||||
|
||||
func MapValue2Scope(value, fromMin, fromMax, toMin, toMax int64) int64 {
|
||||
|
||||
Reference in New Issue
Block a user