I want to display a price such that if the answer is 10.1 the ouput would be 10.10 and if the answer is 20, the output would be 20.00
I have gone through the forums and used so many examples but it still hasn't worked for me. The answer is for rails but I am working on Ruby.s= '%2f' % @price
and the output I get is 12.100000