diff options
author | Eileen M. Uchitelle <eileencodes@gmail.com> | 2015-12-27 09:56:43 -0500 |
---|---|---|
committer | Eileen M. Uchitelle <eileencodes@gmail.com> | 2015-12-27 09:56:43 -0500 |
commit | 85048e90ab6ff6963919a9d10493b3910cd67b68 (patch) | |
tree | ead52c7c926ea8c7cf79adaa7356f6389c2ed28c /guides | |
parent | d5363e58135ea279f2a08c1a2d852ae2d11f0d65 (diff) | |
parent | 3d1f95d0e8ca70f5d892d9b2ed78e99ff7cb3bde (diff) | |
download | rails-85048e90ab6ff6963919a9d10493b3910cd67b68.tar.gz rails-85048e90ab6ff6963919a9d10493b3910cd67b68.tar.bz2 rails-85048e90ab6ff6963919a9d10493b3910cd67b68.zip |
Merge pull request #22759 from akshay-vishnoi/human-size-helper
Add support for Petabyte and Exabyte in number to human size
Diffstat (limited to 'guides')
-rw-r--r-- | guides/source/active_support_core_extensions.md | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/guides/source/active_support_core_extensions.md b/guides/source/active_support_core_extensions.md index 0cb34aa8bc..0aca6db9b6 100644 --- a/guides/source/active_support_core_extensions.md +++ b/guides/source/active_support_core_extensions.md @@ -2024,12 +2024,14 @@ Produce a string representation of a number rounded to a precision: Produce a string representation of a number as a human-readable number of bytes: ```ruby -123.to_s(:human_size) # => 123 Bytes -1234.to_s(:human_size) # => 1.21 KB -12345.to_s(:human_size) # => 12.1 KB -1234567.to_s(:human_size) # => 1.18 MB -1234567890.to_s(:human_size) # => 1.15 GB -1234567890123.to_s(:human_size) # => 1.12 TB +123.to_s(:human_size) # => 123 Bytes +1234.to_s(:human_size) # => 1.21 KB +12345.to_s(:human_size) # => 12.1 KB +1234567.to_s(:human_size) # => 1.18 MB +1234567890.to_s(:human_size) # => 1.15 GB +1234567890123.to_s(:human_size) # => 1.12 TB +1234567890123456.to_s(:human_size) # => 1.1 PB +1234567890123456789.to_s(:human_size) # => 1.07 EB ``` Produce a string representation of a number in human-readable words: |