Add missing ActionView helper number_to_human in guides

This commit is contained in:
Sebastien Auriault 2021-02-11 22:02:30 -05:00
parent afa58dc832
commit 24d1615789
1 changed files with 9 additions and 0 deletions

View File

@ -333,6 +333,15 @@ Formats a number into a currency string (e.g., $13.65).
number_to_currency(1234567890.50) # => $1,234,567,890.50
```
#### number_to_human
Pretty prints (formats and approximates) a number so it is more readable by users; useful for numbers that can get very large.
```ruby
number_to_human(1234) # => 1.23 Thousand
number_to_human(1234567) # => 1.23 Million
```
#### number_to_human_size
Formats the bytes in size into a more understandable representation; useful for reporting file sizes to users.