Convert large numbers into smaller ones with count method.

20 views
Skip to first unread message

David Williams

unread,
Jan 12, 2016, 12:02:50 AM1/12/16
to rubyonra...@googlegroups.com
Big numbers will cause issues within the views when a follower reaches a
certain amount. For example. (1,000,000) How can I convert the number
into 1 Mil or for 1,500,000 into 1.5 Mill?

--
Posted via http://www.ruby-forum.com/.

Hassan Schroeder

unread,
Jan 12, 2016, 12:42:42 AM1/12/16
to rubyonrails-talk
On Mon, Jan 11, 2016 at 9:02 PM, David Williams <li...@ruby-forum.com> wrote:
> Big numbers will cause issues within the views when a follower reaches a
> certain amount. For example. (1,000,000) How can I convert the number
> into 1 Mil or for 1,500,000 into 1.5 Mill?

included for you :-)

ActionView::Helpers::NumberHelper

--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
http://about.me/hassanschroeder
twitter: @hassan
Consulting Availability : Silicon Valley or remote

David Williams

unread,
Jan 12, 2016, 7:03:05 PM1/12/16
to rubyonra...@googlegroups.com
Hassan Schroeder wrote in post #1180540:
Thanks!
Reply all
Reply to author
Forward
0 new messages