The following part of the code works fine in script / console, but returns the following error when I compile it into a ruby script .:
:in `round': wrong number of arguments (1 for 0) (ArgumentError) tf={"ph"=>{0=>1.33333333333333, 1=>1.5}, "fee"=>{0=>1.66666666666667}, "test"=>{0=>1.16666666666667, 1=>1.25}, "what"=>{0=>2.0, 1=>2.0}, "for"=>{0=>1.5}, "is"=>{0=>1.83333333333333, 1=>1.75}} tf.each{|k,v| v.each{|k1,v1| tf[k][k1]=(v1.round(5))}}
Any ideas? Greetings!
floating-point ruby rounding
Shreyas
source share