string number_format ( float
$number
[, int $decimals
= 0 ] )
string number_format ( float
範例與結果$number
, int $decimals
= 0 , string $dec_point
= '.' , string $thousands_sep
= ',' )<?php
$number = 1234.56;
// Englische Notation (Standard)$english_format_number = number_format($number);// 1,235
// Franzoesische Notation$nombre_format_francais = number_format($number, 2, ',', ' ');// 1 234,56
$number = 1234.5678;
// Englische Notation ohne Tausendergruppierung$english_format_number = number_format($number, 2, '.', '');// 1234.57
?>
沒有留言:
張貼留言