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

잔글 (봇: 자동으로 텍스트 교체 (-source +syntaxhighlight))
 
(다른 사용자 한 명의 중간 판 3개는 보이지 않습니다)
2번째 줄: 2번째 줄:
==개요==
==개요==
;PHP number_format()
;PHP number_format()
<source lang='php'>
<syntaxhighlight lang='php' run>
<?php
$num = 1234.5678;
$num = 1234.5678;
echo number_format($num);
echo number_format($num) ."\n";         # 1,235
# 1,235
echo number_format($num,2) ."\n";       # 1,234.57
echo number_format($num,2);
echo number_format($num,2,'','') ."\n"; # 123457
# 1,234.57
echo number_format($num,2,'.','') ."\n"; # 1234.57
echo number_format($num,2,'','');
echo number_format($num,6) ."\n";       # 1,234.567800
# 123457
</syntaxhighlight>
echo number_format($num,2,'.','');
# 1234.57
echo number_format($num,6);
# 1,234.567800
</source>


==같이 보기==
==같이 보기==

2020년 11월 2일 (월) 02:35 기준 최신판

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 }}