From ece15459ed6c143c9c2dba4c4380df36487c9727 Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Tue, 6 May 2025 13:23:32 -0400 Subject: [PATCH] fixed bug where e is capitalized --- answer.txt | 45 +++++++++++++++++++++++++++++++++++++++ examplelist.txt | 56 ++++++++++++++++++++++++------------------------- main.go | 2 ++ 3 files changed, 75 insertions(+), 28 deletions(-) create mode 100644 answer.txt diff --git a/answer.txt b/answer.txt new file mode 100644 index 0000000..bb97599 --- /dev/null +++ b/answer.txt @@ -0,0 +1,45 @@ +UPC +200033148770 +200042041350 +200042041400 +200042064910 +200047796200 +200059594110 +200059660970 +200065290180 +200065290220 +200065290310 +200065290340 +200065290370 +200066707320 +200069556670 +200072791220 +200072791320 +200072791380 +200072791470 +200072950140 +200079186270 +200079343740 +200081451640 +200081630310 +200106953220 +200156488680 +200157056340 +200168095820 +200168979440 +200172490020 +200177334550 +200177780700 +200177788230 +327582805540 +337582889920 +357582840140 +357582843530 +357582850030 +477039522210 +477039522200 +482000077030 +482000077040 +482000077090 +647582802920 +647582804700 diff --git a/examplelist.txt b/examplelist.txt index 9549123..3b966dd 100644 --- a/examplelist.txt +++ b/examplelist.txt @@ -15,31 +15,31 @@ UPC 2.0006955667e+11 2.0007279122e+11 2.0007279132e+11 -2.0007279138e+11 -2.0007279147e+11 -2.0007295014e+11 -2.0007918627e+11 -2.0007934374e+11 -2.0008145164e+11 -2.0008163031e+11 -2.0010695322e+11 -2.0015648868e+11 -2.0015705634e+11 -2.0016809582e+11 -2.0016897944e+11 -2.0017249002e+11 -2.0017733455e+11 -2.001777807e+11 -2.0017778823e+11 -3.2758280554e+11 -3.3758288992e+11 -3.5758284014e+11 -3.5758284353e+11 -3.5758285003e+11 -4.7703952221e+11 -4.770395222e+11 -4.8200007703e+11 -4.8200007704e+11 -4.8200007709e+11 -6.4758280292e+11 -6.475828047e+11 \ No newline at end of file +2.0007279138E+11 +2.0007279147E+11 +2.0007295014E+11 +2.0007918627E+11 +2.0007934374E+11 +2.0008145164E+11 +2.0008163031E+11 +2.0010695322E+11 +2.0015648868E+11 +2.0015705634E+11 +2.0016809582E+11 +2.0016897944E+11 +2.0017249002E+11 +2.0017733455E+11 +2.001777807E+11 +2.0017778823E+11 +3.2758280554E+11 +3.3758288992E+11 +3.5758284014E+11 +3.5758284353E+11 +3.5758285003E+11 +4.7703952221E+11 +4.770395222E+11 +4.8200007703E+11 +4.8200007704E+11 +4.8200007709E+11 +6.4758280292E+11 +6.475828047E+11 diff --git a/main.go b/main.go index 24417d4..1127483 100644 --- a/main.go +++ b/main.go @@ -78,6 +78,8 @@ func main() { continue } + // Lower case the E + upc = strings.ToLower(upc) // Split scientific notation at the e+ point upcArray := strings.Split(upc, "e+")