运行 ❯
获取您
自己的 PHP
服务器
×
更改方向
更改主题,深色/浅色
前往 Spaces
<!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