简单教程
提交运行
代码编辑器:
<?php $u = 123; $txt = sprintf("With 2 decimals: %1$.2f<br>With no decimals: %1$u",$u); echo $txt;
运行结果: