diff options
author | Jon Moss <maclover7@users.noreply.github.com> | 2017-01-15 10:18:06 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-15 10:18:06 -0500 |
commit | 2163874dedaf83e67599c2930c2686caa165fbad (patch) | |
tree | 1f96fb4ffe5aa7f2963178fe8dd6ca73f73ba433 /guides/source | |
parent | 46fdbc5290335ed38fa9fe2b6b0ef8abe4eccb1b (diff) | |
parent | 7b3d663b4d9e58c8bc6c13e2b0ef703af2063a21 (diff) | |
download | rails-2163874dedaf83e67599c2930c2686caa165fbad.tar.gz rails-2163874dedaf83e67599c2930c2686caa165fbad.tar.bz2 rails-2163874dedaf83e67599c2930c2686caa165fbad.zip |
Merge pull request #27686 from koic/friendly_bigdecimal_inspect
Several representation of BigDecimal has changed in Ruby 2.4.0+ [ci skip]
Diffstat (limited to 'guides/source')
-rw-r--r-- | guides/source/active_support_core_extensions.md | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/guides/source/active_support_core_extensions.md b/guides/source/active_support_core_extensions.md index 67bed4c8da..b9f096b82a 100644 --- a/guides/source/active_support_core_extensions.md +++ b/guides/source/active_support_core_extensions.md @@ -1980,7 +1980,15 @@ and that symbol specifiers are also supported: BigDecimal.new(5.00, 6).to_s(:db) # => "5.0" ``` -Engineering notation is still supported: +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: ```ruby BigDecimal.new(5.00, 6).to_s("e") # => "0.5E1" |