Skip to content

Commit b45595b

Browse files
committed
Invert negative amounts
1 parent 8979640 commit b45595b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

bot/transactionBuilder.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ func HandleFloat(m *tb.Message) (string, error) {
4141
if err != nil {
4242
return "", err
4343
}
44+
if v < 0 {
45+
log.Print("Got negative value. Inverting.")
46+
v *= -1
47+
}
4448
log.Printf("Handled float: '%s' -> %f", m.Text, v)
4549
return input, nil
4650
}

0 commit comments

Comments
 (0)