From: Philipp Kempgen Date: 2010-08-21T15:53:12+09:00 Subject: Re: convert 125% into 1.25? From a mathematical aspect the % sign means 1/100 so 125 % equals 1.25. Pen Ttt schrieb (am 21.8.10 07:16): > irb(main):011:0> format("%.2f",125) > => "125.00" > irb(main):012:0> format("%.2f",125%) > SyntaxError: compile error > (irb):12: syntax error, unexpected ')' Ruby does not allow you to write 125% like that. You can however divide 125 by 100 (or rather 100.0 to get a floating point number): format( "%.2f", 125 / 100.0 ) => "1.25" Regards, Philipp