Oscar Lok <oscarlok / sabah.net.my> writes:

> Hi,
> May I know that how to format a float number with specific number of 
> decimal point, please?
> e.g :--
> 123.456789 to 123.4568
> 123.123321 to 123.1233

irb(main):039:0> print [123.456789, 123.123321].collect {|x| format("#{x} to %.4f\n",x)}
123.456789 to 123.4568
123.123321 to 123.1233
=> nil
irb(main):040:0> 

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum