Get your own PHP server Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<?php
$number = 123;
$txt = vsprintf("With 2 decimals: %1\$.2f
<br>With no decimals: %1\$u",array($number));
echo $txt;
?>
</body>
</html>
With 2 decimals: 123.00
With no decimals: 123