Format a float to two decimal places

前端 未结 4 1891
迷失自我
迷失自我 2020-12-17 07:35

I want to format a float value I have to two decimal places.

For example if I have a float for a price of 5.2, I want it to be formatted as 5.20

4条回答
提交回复
热议问题