From 3d1f95d0e8ca70f5d892d9b2ed78e99ff7cb3bde Mon Sep 17 00:00:00 2001 From: Akshay Vishnoi Date: Tue, 22 Dec 2015 23:05:50 +0530 Subject: Add support for Petabyte and Exabyte in number to human size --- activesupport/lib/active_support/number_helper.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'activesupport/lib/active_support/number_helper.rb') diff --git a/activesupport/lib/active_support/number_helper.rb b/activesupport/lib/active_support/number_helper.rb index 248521e677..191ac0dac5 100644 --- a/activesupport/lib/active_support/number_helper.rb +++ b/activesupport/lib/active_support/number_helper.rb @@ -235,6 +235,8 @@ module ActiveSupport # number_to_human_size(1234567) # => 1.18 MB # number_to_human_size(1234567890) # => 1.15 GB # number_to_human_size(1234567890123) # => 1.12 TB + # number_to_human_size(1234567890123456) # => 1.1 PB + # number_to_human_size(1234567890123456789) # => 1.07 EB # number_to_human_size(1234567, precision: 2) # => 1.2 MB # number_to_human_size(483989, precision: 2) # => 470 KB # number_to_human_size(1234567, precision: 2, separator: ',') # => 1,2 MB -- cgit v1.2.3