By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,614 Members | 1,680 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,614 IT Pros & Developers. It's quick & easy.

Rounding problem

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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.