Click to See Complete Forum and Search --> : changing thouthands_sep globaly
valenok
07-16-2008, 05:52 PM
I need the number groups separated with space
instead of comma. Number format wouldn't do as the numbers amount on the page is pretty big.
P.s atm the number isnt being formated at all
<?
$num = 7123487943218671;
echo $num;
// outputs 7123487943218671 instead of 7 123 487 943 218 671
Thx ahead.
TheSkyOrBust
07-16-2008, 06:04 PM
I think I'm right in saying number format would work in this syntax
$format = number_format($num, 0, '.', ' ');
echo $format;
0 indicating how many decimal places, the '.' representing the decimal point, and the ' ' determining what should be used as a group separator.
Having tried it out, it returned 7 123 487 943 218 671, as it should do I imagine. This probably doesn't help but it's something to consider.
valenok
07-16-2008, 06:26 PM
Thanks for your reply, but for emphases - I'll repeat
Number_format wouldn't do as the numbers amount on the page is pretty big
and I don't want to apply number_format to each numerical output.
--
<?
$num = 7123487943218671;
echo $num;
outputs 7123487943218671 instead of 7 123 487 943 218 671
valenok
07-17-2008, 04:12 AM
Anything useful ?
I thought of changing locales with LC_NUMERIC
to one with space thousands separator, but couldn't find one.
rm_webdeveloper
07-17-2008, 04:17 AM
what do you mean? give me an example.
1 2 3 4 5 6 7 8 9 10? like this?
valenok
07-17-2008, 05:01 AM
every 3 symbols (separate thousands from)
1234567 as 1 234 567
separated group numbers ( hundreds, thousands, millions)