Close
Glad You're Ready. Let's Get Started!

Let us know how we can contact you.

Thank you!

We'll respond shortly.

PIVOTAL LABS
02/01/2013 – Don't Byte Me (SF STANDUP)

Interestings

Don’t Byte Me

If you’re looking at your code and realizing “I need this number in bytes, not MB so I can use Rails’s handy number_to_human_size helper”, don’t forget that the Numeric class is there to help!

5.megabytes => 5242880 == 5*1024*1024

number_to_human_size(5.megabytes) => “5 MB” == YAHTZEE!

Comments
Post a Comment

Your Information (Name required. Email address will not be displayed with comment.)

* Copy This Password *

* Type Or Paste Password Here *