PDA

View Full Version : How do you round a number in Ruby? And more importantly, where could I look this up?



tc101
May 9th, 2007, 04:00 PM
How do you round a number in Ruby? And more importantly, where could I look up something like this in an online web manual?

tc101
May 9th, 2007, 04:08 PM
I figured out how to round a number just through trial and error, but I still want to know where I could look up something like this.

mazirian
May 9th, 2007, 04:13 PM
http://www.ruby-lang.org/en/

skeeterbug
May 9th, 2007, 05:49 PM
I figured out how to round a number just through trial and error, but I still want to know where I could look up something like this.

One of my personal favorite sites: http://www.ruby-doc.org/docs/ProgrammingRuby/

You can also open irb and type something like this:
$> i = 1
$> i.methods

mazirian
May 9th, 2007, 06:25 PM
Oh, yeah, also check out the vim/emacs plugins for ruby available as gems from eigenclass.org. He wroite the fastri server that allows for access to the documentation much more easily and quickly.

winch
May 9th, 2007, 09:44 PM
Or you could also use ri (http://dev.rubycentral.com/downloads/ri.html).