Examples 例子1.vfprintf(): zero-padded integers <?php if (!($fp=fopen('date.txt','w'))) return; vfprintf($fp,"%04d-%02d-%02d", array($year,$month,$day)); // will write the formatted ISO date to date.txt ?>
這倆段代碼幫助你添加逗號到每三位數(shù)字中,這讓大的數(shù)字比較容易查看。 代碼1: 復(fù)制代碼代碼如下: function CommaFormatted(amount) { var delimiter = ","; // replace comma if desired amount = new String(amount); var a = amount.split('.',2) ...