Bug #2794: sprintf/printf work as (float) round()

From: Date: Mon, 22 Nov 1999 17:40:37 +0000
Subject: Bug #2794: sprintf/printf work as (float) round()
Groups: php.dev 
Request: Send a blank email to php-dev+get-12930@lists.php.net to get a copy of this message
From: madmax@express.ru Operating system: FreeBSD 3.0-RELEASE PHP version: 3.0.12 PHP Bug Type: Misbehaving function Bug description: sprintf/printf work as (float) round() <? $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

« previous php.dev (#12930) next »