Compare commits

...

2 Commits

Author SHA1 Message Date
2fa6aef836 deleted answer file 2025-05-06 17:03:49 -04:00
25a7658328 fixed bug where real numbers crashed app 2025-05-06 16:52:18 -04:00
3 changed files with 16 additions and 0 deletions

View File

@@ -14,6 +14,7 @@ UPC
2.0006670732e+11
2.0006955667e+11
2.0007279122e+11
0075849385857
2.0007279132e+11
2.0007279138E+11
2.0007279147E+11

10
isNumeric.go Normal file
View File

@@ -0,0 +1,10 @@
package main
import (
"regexp"
)
func isNumeric(s string) bool {
match, _ := regexp.MatchString("^[0-9]+$", s)
return match
}

View File

@@ -78,6 +78,11 @@ func main() {
continue
}
if isNumeric(upc) == true {
gtins = append(gtins, upc)
continue
}
// Lower case the E
upc = strings.ToLower(upc)
// Split scientific notation at the e+ point