Pivotal Labs

Main menu

Skip to primary content
Skip to secondary content
  • About
  • Case Studies
  • Team
    • Executives
    • Locations
      • San Francisco (HQ)
      • Boston
      • Boulder
      • Denver
      • London
      • Los Angeles
      • New York
  • Community
    • Blogs
    • Tech Talks
    • Events
  • Careers
    • Lifestyle
    • Principles & Practices
    • Benefits
    • FAQ
    • Apply
  • Contact
    • Press Room
    • Press Releases
    • In The News
    • Press Kit
  • All
  • Labs
  • Standup
  • Tracker

02/01/2013 – Don’t Byte Me (SF STANDUP)

Helge Holzmann
Friday, February 1, 2013

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!

  • 0 Shares
  • Share on Facebook
  • Share on Twitter

Add New Comment Cancel reply

Your email address will not be published.

Helge Holzmann

Helge Holzmann
San Francisco

Recent Posts

  • 1/31/2013 – find_by_name where name is strange (SF STANDUP)
  • 1/29/2013 – Rails hacked again (SF Standup)
  • 1/28/2013 – Upgrade your Devises (SF Standup)
Subscribe to Helge's Feed

Author Topics

agile (4)
  • About
  • Case Studies
  • Team
  • Community
  • Careers
  • Contact
  • Labs
  • Events

Contact Us

contact@pivotallabs.com
+1 415-77-PIVOT
TwitterLinkedInFacebook

Pivotal Tracker

Tracker is the award-winning agile project management tool that enables real-time collaboration around a shared, prioritized backlog.
Visit pivotaltracker.com >