mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Revert "Merge pull request #27686 from koic/friendly_bigdecimal_inspect"
The exact inspect output of a BigDecimal is out of scope for what we're trying to communicate about `dup` and `duplicable?` here. Adding two examples distracts is disctracting, so keep the docs from before since our minimal version is Ruby 2.2.2. [ Koichi ITO, Jon Moss, Kasper Timm Hansen ] This reverts commit2163874ded
, reversing changes made to46fdbc5290
.
This commit is contained in:
parent
a0a1ede8c2
commit
7c3a99eeca
2 changed files with 1 additions and 16 deletions
|
@ -107,13 +107,6 @@ class BigDecimal
|
|||
# BigDecimals are duplicable:
|
||||
#
|
||||
# BigDecimal.new("1.2").duplicable? # => true
|
||||
#
|
||||
# In Ruby 2.4.0:
|
||||
#
|
||||
# BigDecimal.new("1.2").dup # => 0.12e1
|
||||
#
|
||||
# Whereas in Ruby 2.2 and 2.3:
|
||||
#
|
||||
# BigDecimal.new("1.2").dup # => #<BigDecimal:...,'0.12E1',18(18)>
|
||||
def duplicable?
|
||||
true
|
||||
|
|
|
@ -1980,15 +1980,7 @@ and that symbol specifiers are also supported:
|
|||
BigDecimal.new(5.00, 6).to_s(:db) # => "5.0"
|
||||
```
|
||||
|
||||
Engineering notation is still supported.
|
||||
|
||||
In Ruby 2.4:
|
||||
|
||||
```ruby
|
||||
BigDecimal.new(5.00, 6).to_s("e") # => "0.5e1"
|
||||
```
|
||||
|
||||
Whereas in Ruby 2.2 and 2.3:
|
||||
Engineering notation is still supported:
|
||||
|
||||
```ruby
|
||||
BigDecimal.new(5.00, 6).to_s("e") # => "0.5E1"
|
||||
|
|
Loading…
Reference in a new issue