"PHP number format()"의 두 판 사이의 차이

3번째 줄: 3번째 줄:
;PHP number_format()
;PHP number_format()
<source lang='php' run>
<source lang='php' run>
<?php
$num = 1234.5678;
$num = 1234.5678;
echo number_format($num)  ."\n";        # 1,235
echo number_format($num)  ."\n";        # 1,235

2020년 2월 17일 (월) 01:46 판

1 개요

PHP number_format()
$num = 1234.5678;
echo number_format($num)  ."\n";         # 1,235
echo number_format($num,2) ."\n";        # 1,234.57
echo number_format($num,2,'','') ."\n";  # 123457
echo number_format($num,2,'.','') ."\n"; # 1234.57
echo number_format($num,6) ."\n";        # 1,234.567800

2 같이 보기

3 참고

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}