Closed jwoertink closed 1 year ago
Here's a play link with the error: https://play.crystal-lang.org/#/r/dqf8
Turns out this is a Crystal bug... maybe fixed by https://github.com/crystal-lang/crystal/pull/12448 ?
I tried against 1.6.0-dev and it works, but 1.5.1 it's broken.
❯ ./bin/crystal eval 'pp "%.0f" % 100.0'
Using compiled compiler at .build/crystal
"100"
❯ crystal eval 'pp "%.0f" % 100.0'
Unhandled exception: Malformed format string - %'0' (ArgumentError)
Closing this since it'll be fixed by Crystal 1.6 being released next week.
https://github.com/luckyframework/lucky/blob/dd61285fd250f6b18a8b9ceb80e2484e50773e84/src/lucky/page_helpers/number_to_currency.cr#L24
Passing a precision of 0 will those that error
"%.0f" % 100.0