Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Prodentim Probiotics Specially Designed For The Health Of Your Teeth And Gums

Instant Grammar Checker - Correct all grammar errors and enhance your writing

Teach Your Child To Read

Powerful WordPress hosting for WordPress professionals

Disclosure: My content contains affiliate links.

31,104 questions

40,777 answers

573 users

How to format number in PHP

10 Answers

0 votes
$n = 84763.96;

echo number_format($n);

/*
run

84,764

*/

 





answered Dec 2, 2015 by avibootz
0 votes
$n = 84763.50;

echo number_format($n);

/*
run

84,764

*/

 





answered Dec 2, 2015 by avibootz
0 votes
$n = 84763.49;

echo number_format($n);

/*
run

84,763

*/

 





answered Dec 2, 2015 by avibootz
0 votes
$n = 84763.49;

echo number_format($n, 2);

/*
run

84,763.49

*/

 





answered Dec 2, 2015 by avibootz
0 votes
$n = 84763.96;

echo number_format($n, 2);

/*
run

84,763.96

*/

 





answered Dec 2, 2015 by avibootz
0 votes
$n = 847563.96;

echo number_format($n, 2);

/*
run

847,563.96

*/

 





answered Dec 2, 2015 by avibootz
0 votes
$n = 1847563.96;

echo number_format($n, 2);

/*
run

1,847,563.96

*/

 





answered Dec 2, 2015 by avibootz
0 votes
$n = 31847563.96;

echo number_format($n, 2);

/*
run

31,847,563.96

*/

 





answered Dec 2, 2015 by avibootz
0 votes
$n = 41847563.96;

echo number_format($n, 2, '.', ',');

/*
run

41,847,563.96

*/

 





answered Dec 2, 2015 by avibootz
0 votes
$n = 21847563.96;

echo number_format($n, 2, ',', '.');

/*
run

21.847.563,96

*/

 





answered Dec 2, 2015 by avibootz

Related questions

2 answers 35 views
1 answer 45 views
2 answers 102 views
7 answers 277 views
...