how to format floating point number

In Ruby or Rails? If you are using rails, it comes with a nice helper method called number_to_currency.

Use it like so,

number_to_currency(15.0) or number_to_currency(variable_name)

Hope that helps, Tyler Prete