Rails 3. How to display two decimal places in edit form?

前端 未结 4 2009

I have this edit form.

But when I store something such as 1.5, I would like to display it as 1.50.

How could I do that with the form helper? <%= f.

4条回答
  •  鱼传尺愫
    2020-12-04 13:27

    Rails has a number_to_currency helper method which might fit you specific use case better.

提交回复
热议问题