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

formatting number

P: n/a
Hi

Can sombody tell me the best way to format a number in this way.

456.45657 must be 456,46

So the point becoms a comma and I would have 2 digits i.pv. 5

thanks,

Alain
Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
I noticed that Message-ID: <c5**********@news.worldonline.be> from Alain
Dhaene contained the following:
Can sombody tell me the best way to format a number in this way.

456.45657 must be 456,46

So the point becoms a comma and I would have 2 digits i.pv. 5


http://uk.php.net/number_format

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #2

P: n/a
On Sat, 10 Apr 2004 09:14:16 +0200, Alain Dhaene wrote:
Can sombody tell me the best way to format a number in this way.

456.45657 must be 456,46

So the point becoms a comma and I would have 2 digits i.pv. 5


Take care of precision:
http://www.php.net/manual/en/function.round.php

Fix the output format:
http://www.php.net/manual/en/function.number-format.php

--
mvh/regards
Joachim Mæland

If everything seems under control, you're just not going fast enough.
-Mario Andretti

Jul 17 '05 #3

P: n/a
"Geoff Berrow" <bl******@ckdog.co.uk> wrote in message
news:9n********************************@4ax.com...
I noticed that Message-ID: <c5**********@news.worldonline.be> from Alain
Dhaene contained the following:
Can sombody tell me the best way to format a number in this way.

456.45657 must be 456,46

So the point becoms a comma and I would have 2 digits i.pv. 5


http://uk.php.net/number_format


There's also setlocale(), although using it is somewhat dicey.
Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.