|
@@ -2090,14 +2090,13 @@ func GetColorMap() map[int]string {
|
|
|
|
|
|
|
|
|
func IsPercentage(input string) (bool, string) {
|
|
|
- percentagePattern := `^(\d{1,2}(\.\d{1,2})?)%$`
|
|
|
+ percentagePattern := `^-?(\d{1,2}(\.\d{1,2})?)%$`
|
|
|
match, _ := regexp.MatchString(percentagePattern, input)
|
|
|
|
|
|
if match {
|
|
|
-
|
|
|
re := regexp.MustCompile(percentagePattern)
|
|
|
match := re.FindStringSubmatch(input)
|
|
|
- return true, match[1]
|
|
|
+ return true, match[1]
|
|
|
}
|
|
|
|
|
|
return false, ""
|