Converting Integer String to Money Format

前端 未结 4 2073
情歌与酒
情歌与酒 2020-12-19 17:51

I have a set of integers that I would like to change to a US money format.

Here are some examples of what I would like to do. The first number is what is in the dat

4条回答
  •  难免孤独
    2020-12-19 18:40

    You could use number_format()

    number_format((4500/100), 2);
    

    There's also money_format(), but it's slightly more complicated.

提交回复
热议问题