I’m just blundering around for fun, attempting to format the ‘hits’ variable output with a comma for one particular template.
EE 2.1.3
PHP 5.2 (also tried 5.3)
PHP processed on template output
My test template contains these attempts to tease out where the error might be since I know nothing:
1. <?php echo "{hits}"; ?>
2. <?php echo number_format( "{hits}" ); ?>
3. <?php $number ="{hits}"; echo number_format( $number ,0 ); ?> which outputs this:
1. 155052
2. 0
3. 0
I’ve tried cutting and pasting a few other number_format examples I found various places, but it seems I really only need the simplest use case of one argument, which should just be a whole number with thousands delimited by a comma. Why the ‘0’ results?
I’m pretty much a “cut-n-paste PHP newbie” so apologies in advance if I’m staring something obvious right in the eye 😛