README.md in flt-1.5.2 vs README.md in flt-1.5.3
- old
+ new
@@ -359,18 +359,18 @@
```ruby
DecNum.context.define_conversion_from(BigDecimal) do |x, context|
DecNum(x.to_s)
end
DecNum.context.define_conversion_to(BigDecimal) do |x|
- BigDecimal.new(x.to_s)
+ BigDecimal(x.to_s)
end
```
Now we can mix `BigDecimals` and `Decimals` in expressions and convert from `DecNum`
to `BigDecimal`:
```ruby
-puts BigDecimal.new('1.1') + DecNum('2.2') # -> 3.3
+puts BigDecimal('1.1') + DecNum('2.2') # -> 3.3
puts DecNum('1.1').convert_to(BigDecimal) # -> 0.11E1
```
Note that the conversions are defined in a `Context` object and will be
available only when that context applies. That way we can define conversions