Compare commits
2 Commits
41f592ec45
...
main
Author | SHA1 | Date | |
---|---|---|---|
2fa6aef836 | |||
25a7658328 |
@@ -14,6 +14,7 @@ UPC
|
|||||||
2.0006670732e+11
|
2.0006670732e+11
|
||||||
2.0006955667e+11
|
2.0006955667e+11
|
||||||
2.0007279122e+11
|
2.0007279122e+11
|
||||||
|
0075849385857
|
||||||
2.0007279132e+11
|
2.0007279132e+11
|
||||||
2.0007279138E+11
|
2.0007279138E+11
|
||||||
2.0007279147E+11
|
2.0007279147E+11
|
||||||
|
10
isNumeric.go
Normal file
10
isNumeric.go
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"regexp"
|
||||||
|
)
|
||||||
|
|
||||||
|
func isNumeric(s string) bool {
|
||||||
|
match, _ := regexp.MatchString("^[0-9]+$", s)
|
||||||
|
return match
|
||||||
|
}
|
5
main.go
5
main.go
@@ -78,6 +78,11 @@ func main() {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if isNumeric(upc) == true {
|
||||||
|
gtins = append(gtins, upc)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
// Lower case the E
|
// Lower case the E
|
||||||
upc = strings.ToLower(upc)
|
upc = strings.ToLower(upc)
|
||||||
// Split scientific notation at the e+ point
|
// Split scientific notation at the e+ point
|
||||||
|
Reference in New Issue
Block a user