convert big number to 1.6G, 24K, 2M etc format?

P

Phlip

Given that "K G M" is deucedly hard to Google for, I'm gonna have to
start writing this. (Yes it's probably easy...)

While I do, have I overlooked something obvious? Raw Ruby, or Rails,
or a snippet, thanks!
 
P

Phlip

Given that "K G M" is deucedly hard to Google for, I'm gonna have to
start writing this. (Yes it's probably easy...)

Oh duh it's action_view/helpers/number_helper.rb:
number_to_human_size()

Just search for KB GB MB.

Darn it! I never get to write any original algorithms these days!!

(Careful what we wish for, right?;)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,905
Latest member
Kristy_Poole

Latest Threads

Top