how i can make this numbers format in php
assume i have a number 1000 i want php function convert it into 1,000
how i can do that?
2 Answers
0 of 0 people found this answer helpful. Did you? Yes No
Use number_format()
$strNum = number_format(1000);There is no requirement to use the 4 parameter overload, as (from the documentation) If only one parameter is given, number will be formatted without decimals, but with a comma (",") between every group of thousands. So number_format(1000);is in effect number_format(1000, 0, '.', ','); Posted: riatorewall 2 of 2 people found this answer helpful. Did you? Yes No |
© Advanced Web Core. All rights reserved