mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Add missing ActionView helper number_to_human in guides
This commit is contained in:
parent
afa58dc832
commit
24d1615789
1 changed files with 9 additions and 0 deletions
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue