Author Topic: number_format  (Read 43 times)

Matt

  • Administrator
  • Jr. Member
  • *****
  • Posts: 83
    • View Profile
number_format
« on: August 20, 2011, 04:55:32 AM »
I've changed how phpBB displays thousands by adding the number_format() to the totals. However, there are some which needed a bit of playing with before it would work.
For the forum stats at the bottom of the index page:
Before

'TOTAL_POSTS'                           => sprintf($user->lang[$l_total_post_s], $total_posts),
'TOTAL_TOPICS'                          => sprintf($user->lang[$l_total_topic_s], $total_topics),
'TOTAL_USERS'                           => sprintf($user->lang[$l_total_user_s], $total_users), 

After:

'TOTAL_POSTS'                           => sprintf(str_replace('%d''%s'$user->lang[$l_total_post_s]), number_format($total_posts)),
'TOTAL_TOPICS'                          => sprintf(str_replace('%d''%s'$user->lang[$l_total_topic_s]), number_format($total_topics)),
'TOTAL_USERS'                           => sprintf(str_replace('%d''%s'$user->lang[$l_total_user_s]), number_format($total_users)), 
« Last Edit: December 14, 2011, 07:39:16 AM by Matt »
250.5BHP & 266lb/ft