to_s

rat.to_s â string
Instance Public methods

Returns the value as a string.

Rational(2).to_s      #=> "2/1"
Rational(-8, 6).to_s  #=> "-4/3"
Rational('1/2').to_s  #=> "1/2"
doc_ruby_on_rails
2015-05-01 04:42:45
Comments
Leave a Comment

Please login to continue.