top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Any reason why printf() does not support formats with thousands separator in PHP?

0 votes
186 views

I've recently discovered that a format such as %'.2f" results in this:

php -r "printf("%'.2f", 23232323.237);"
23232323.237000

I know that number_format() will do the same, but I am given the format spec as an interface, I would need to try to parse it and then decide whether to use printf() or number_format().

posted Jul 10, 2017 by anonymous

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button

Similar Questions
+1 vote

windows phone 8 application TextBox accept currency values display decimal,thousand comma seperator
eg: 120.00// 1,200.00 etc

+1 vote

I've been doing some research on frameworks, etc. Everyone has one they like and even the development environments that you can get have their favorites and books seem to have their favorites. I've been looking at Cake, Symfony, Zend, PEAR-Flexy, Smarty, Joomla, etc., etc., etc. I'm not going to ask which framework everyone likes best because that's pointless.

All of the web hosting control panels/billing systems do not support the technologies that I'm currently using (dbmail, powerdns). To that end, I need to write my own. Should I be using a framework at all?

0 votes

Why ${0} is valid but ${0 is not valid? it means that curly braces evaluate what's inside them and that's why we
cannot have ${0?

Variables shouldn't start from 0 so it means that it started from braces? if yes why I cannot have ${0? and what is the variable here finally? $0 is what it interprets? if yes so it is not a legal variable.

...