Commit 22e979a
authored
Use floating-point format for BigDecimal stringification (#2022)
## Summary
- BigDecimal values now stringify using `to_s("F")` format instead of the default `to_s`
## Why
Ruby's default `BigDecimal#to_s` produces engineering/scientific notation for certain values:
```ruby
BigDecimal("0.00001").to_s # => "0.1E-4"
BigDecimal("12345678.9").to_s # => "0.123456789E8"
```
This is rarely the desired output in templates. Using `to_s("F")` produces the expected floating-point format:
```ruby
BigDecimal("0.00001").to_s("F") # => "0.00001"
BigDecimal("12345678.9").to_s("F") # => "12345678.9"
```1 parent 735d551 commit 22e979a
1 file changed
+2
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| 98 | + | |
| 99 | + | |
98 | 100 | | |
99 | 101 | | |
100 | 102 | | |
| |||
0 commit comments