From 24d16157895e0ed5882c8daaa007688f17344949 Mon Sep 17 00:00:00 2001 From: Sebastien Auriault Date: Thu, 11 Feb 2021 22:02:30 -0500 Subject: [PATCH] Add missing ActionView helper number_to_human in guides --- guides/source/action_view_helpers.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/guides/source/action_view_helpers.md b/guides/source/action_view_helpers.md index 24d85c3ce0..304ca6d02b 100644 --- a/guides/source/action_view_helpers.md +++ b/guides/source/action_view_helpers.md @@ -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.