<!DOCTYPE html>
<html>
<body>
<?php
$number = 123;
$txt = vsprintf("保留两位小数:%1\$.2f
<br>不保留小数:%1\$u", array($number));
echo $txt;
?>
</body>
</html>