I have data 18000 in my database and the datatype is decimal but the length of decimal is empty. How do I make it into 18,000.00 as an output?
2条回答 默认 最新
- dongzhang6021 2016-03-29 13:54关注
You can use number_format() function here.
$number = 18000; $formatted_number = number_format($number, 2, '.', ','); // Gives 18,000.00
Hope this helps.
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报