470,815 Members | 1,136 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,815 developers. It's quick & easy.

Rounding problem

Hi there,

If I use round(1.95583, 2); I would get the perfect result of 1.96 for my
currency. But if I round(1.9) I would just get 1.9. Is there a function or
solution so it would always round with 2 digits for a currency?

thnxz...
Jul 16 '05 #1
2 2604
Roger Godefroy <godefroy@(nospam)home.nl> wrote:
Hi there,

If I use round(1.95583, 2); I would get the perfect result of 1.96 for my
currency. But if I round(1.9) I would just get 1.9. Is there a function or
solution so it would always round with 2 digits for a currency?

thnxz...


Check out number_format()

http://php.net/number_format
--
Eivind Lie Nitter
el*@gmx.net
http://ununique.net
Jul 16 '05 #2
Thanks... problem solved...

"Eivind Lie Nitter" <el*@gmx.net> schreef in bericht
news:1fz48pq.1osmy9s1p53lz8N%el*@gmx.net...
Roger Godefroy <godefroy@(nospam)home.nl> wrote:
Hi there,

If I use round(1.95583, 2); I would get the perfect result of 1.96 for my currency. But if I round(1.9) I would just get 1.9. Is there a function or solution so it would always round with 2 digits for a currency?

thnxz...


Check out number_format()

http://php.net/number_format
--
Eivind Lie Nitter
el*@gmx.net
http://ununique.net

Jul 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Rick Gabel | last post: by
5 posts views Thread by Jason | last post: by
4 posts views Thread by Altman | last post: by
29 posts views Thread by Marco | last post: by
18 posts views Thread by jdrott1 | last post: by
206 posts views Thread by md | last post: by
20 posts views Thread by jacob navia | last post: by
30 posts views Thread by bdsatish | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.