Re: string_format rounding error..

Danilo Buerger <[email protected]> Tue, 23 Jan 2007 12:48:59 +0100
Newsgroups gmane.comp.php.smarty.devel
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



messju mohr schrieb:
> In-Reply-To: <[email protected]>
> 
> On Tue, Jan 23, 2007 at 11:31:49AM +0000, Jonathan Lozinski wrote:
>> Smarty Version: 2.6.0  (on debian stable)
>> There is a rounding problme with .xx5 on smarty's string_format:"%.2f" 
>> modifier.  This some times get correct, other times not.
> 
> string_format uses php's sprintf() internally and thus inherits all
> bugs and limitations from it.
> 
> for example: http://bugs.php.net/bug.php?id=35442
> 

And as the bug report mentions, check out round(). Thats probably what
you want anyway.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFtfYqrwsg9y2CBIURAgfWAKCkJGLZrNxfmlpwbfyH4710GCdVcwCfZx6b
ynLMz8s2AhjsvD2k0PoZLdI=
=ScRV
-----END PGP SIGNATURE-----

-- 
Smarty Development Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php