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

2번째 줄: 2번째 줄:
;number_format()
;number_format()
<source lang='php'>
<source lang='php'>
<?php
$num = 1234.5678;
$num = 1234.5678;
echo number_format($num);
echo number_format($num);
# 1,235
echo number_format($num,2);
echo number_format($num,2);
# 1,234.57
echo number_format($num,2,'','');
# 123457
echo number_format($num,2,'.','');
# 1234.57
echo number_format($num,6);
echo number_format($num,6);
# 1,235
# 1,234.57
# 1,234.567800
# 1,234.567800
echo number_format(1, 2); // 1.00
</source>
</source>



2018년 8월 16일 (목) 09:43 판

1 개요

number_format()
<?php
$num = 1234.5678;
echo number_format($num);
# 1,235
echo number_format($num,2);
# 1,234.57
echo number_format($num,2,'','');
# 123457
echo number_format($num,2,'.','');
# 1234.57
echo number_format($num,6);
# 1,234.567800

2 같이 보기

3 참고

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