Re: [SMARTY-DEV] string_format rounding error..
| From: | Danilo Buerger | Date: | Tue, 23 Jan 2007 11:48:59 +0000 |
| Subject: | Re: [SMARTY-DEV] string_format rounding error.. | ||
| References: | 1 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-2938@lists.php.net to get a copy of this message | ||
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
messju mohr schrieb:
> In-Reply-To: <45B5F225.30600@sbsquared.com>
>
> 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-----