Skip to content

Commit

Permalink
Invert negative amounts
Browse files Browse the repository at this point in the history
  • Loading branch information
LucaBernstein committed Nov 2, 2021
1 parent 8979640 commit b45595b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bot/transactionBuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ func HandleFloat(m *tb.Message) (string, error) {
if err != nil {
return "", err
}
if v < 0 {
log.Print("Got negative value. Inverting.")
v *= -1
}
log.Printf("Handled float: '%s' -> %f", m.Text, v)
return input, nil
}
Expand Down

0 comments on commit b45595b

Please sign in to comment.