In C or C++, it’s can be a pain to get thousands separators in printf. In ruby, it can be trivial, as long as you use the right libraries. If you have ActiveSupport
installed (which I believe comes with Rails), you’re all set. Note that you don’t have to be using Rails; this will work in a plain ruby script.
1 2 3 4 5 6 7 8 9 |
|
number_with_delimiter
is great, and number_to_human
is a nice bonus.
For the record, software versions and the install command:
1 2 3 4 5 |
|