MyBB Community Forums

Full Version: Decimal in stats
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So I tried this http://number_format.onlinephpfunctions.com/ (when typing in numbers, it works). But I want it to work with these

{$stats['numposts']}
{$stats['numthreads']}
{$stats['numusers']}

It just shows up blank. Any help? lol.
Still need help with this.
Have you checked what your value for thousands_separator is? ACP->Config->General Configuration.
(2015-04-09, 11:48 PM)dragonexpert Wrote: [ -> ]Have you checked what your value for thousands_separator is? ACP->Config->General Configuration.

[Image: v5LXzX9.png]



And I'm using these variables on the Index page (in the templates)

{$stats['numposts']}
{$stats['numthreads']}
{$stats['numusers']}
The stats (from cache) are string and not integers.
You need to wrap all 3 variables with the my_number_format() function. Template Conditional plugin: http://mybbhacks.zingaburga.com/showthre...464&page=6 allows doing that in templates with the <?= => syntax.
Solved.