Re: Thousands Separator

From: Date: Fri, 16 Jan 2015 18:55:03 +0000
Subject: Re: Thousands Separator
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-324254@lists.php.net to get a copy of this message
On 15-01-16 01:49 PM, Jennifer wrote:
I hate to ask what seems to be a simple question but, does PHP have a thousands separator for large numbers in constants or variables? In Perl, you can use the underscore, e.g. $num = '123_456_789', but that doesn't work in PHP. I can't find an answer anywhere, so I hope the answer isn't "no". :\ Thank you, Jenni
Normally you format numbers when creating output. This tells you how to it: http://php.net/number_format If you want to store them in a file or a database with the formatting, you would have to store them as strings. -- Stephen

« previous php.general (#324254) next »