duanmeng7865 2012-10-11 11:51
浏览 143
已采纳

如何在php中将默认输入值设置为0.00? [重复]

Possible Duplicate:
PHP: show a number to 2 decimal places

How can I format an input number to be 0.00 if it has not any value? I tried (double) but it prints 0 only.

  • 写回答

6条回答 默认 最新

  • dongxixia6399 2012-10-11 11:52
    关注

    Here you go :)

    echo number_format($var,2);
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(5条)
编辑
预览

报告相同问题?