Ruby Quicktips Logo

Ruby Quicktips

Random Ruby and Rails tips.
This blog is dedicated to deliver short, interesting and practical tidbits of the Ruby language and Ruby on Rails framework. Read more...

Your submissions are more than welcome!
Dec 2 ’10

Big Numbers

Your number has too many zeros? In ruby you can make that more readable (and easier to write!) by using underscores:

moneys = 1_000_000.00
=> 1000000.0

(Source: rubyloveinfo)

7 notes 0 comments (via rubyloveinfo)

  1. jaredengler reblogged this from rubyquicktips
  2. reddavis reblogged this from rubyquicktips
  3. rubyquicktips reblogged this from rubyloveinfo
  4. rubyloveinfo posted this

Comments

You can use HTML tags for formatting. Wrap code in <code> tags and multiple lines of code in <pre><code> tags.

blog comments powered by Disqus