|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[1999-11-29 18:52 UTC] joey at cvs dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 10 20:00:02 2026 UTC |
<? $tst1="1234.5678"; $tst2="1234.4321"; $out1=sprintf("%01.2f", $tst1); $out2=sprintf("%01.2f", $tst2); $out3=sprintf("%01.0f", $tst1); $out4=sprintf("%01.0f", $tst2); print "$tst1<==>$tst2<br>$out1<==>$out2<br>$out3<==>$out4"; ?> output was: 1234.5678<==>1234.4321 1234.57<==>1234.43 1235<==>1234