price fixes

This commit is contained in:
bronkuu 2026-06-15 15:50:17 +02:00
parent 2940f00142
commit 8d81940faf
4 changed files with 66 additions and 47 deletions

View file

@ -31,6 +31,11 @@ func TestParsePrice(t *testing.T) {
if err != nil || p != 199 {
t.Fatal(s, p)
}
s = "1,99"
p, err = ParsePrice(s)
if err != nil || p != 199 {
t.Fatal(s, p)
}
s = "1123"
p, err = ParsePrice(s)
if err != nil || p != 112300 {
@ -41,15 +46,4 @@ func TestParsePrice(t *testing.T) {
if err == nil {
t.Fatal(s, "should error")
}
s = "1123.3"
_, err = ParsePrice(s)
if err == nil {
t.Fatal(s, "should error")
}
s = "1123,33"
_, err = ParsePrice(s)
if err == nil {
t.Fatal(s, "should error")
}
}