Author Topic: 2.1 Suggestion for Subs-List.php...  (Read 1339 times)

Offline Matthew K.

  • SMF Super Hero
  • *******
  • Posts: 12,430
  • Gender: Male
    • matthew.kerle on Facebook
    • @matthew_kerle on Twitter
2.1 Suggestion for Subs-List.php...
« on: April 02, 2016, 03:56:47 PM »
Wasn't sure exactly where to post this...but it'd be really nice to have "number_format" be an option in Subs-List.php createList column options. If you look currently (at least in SMF 2.0) there are options to format using comma_format(), and timeformat(), so it seems logical to add one more condition checking for number_format(), which would be really useful. Also being able to add params to those functions would be nice.

Code: (Find) [Select]
// Allow for basic formatting.
if (!empty($column['data']['comma_format']))
$cur_data['value'] = comma_format($cur_data['value']);
elseif (!empty($column['data']['timeformat']))
$cur_data['value'] = timeformat($cur_data['value']);
Code: (Add After) [Select]
elseif (!empty($column['data']['number_format']))
$cur_data['value'] = number_format($cur_data['value']);
It'd also be really easy to add in the options for params on all three of those functions which would largely increase compatibility and encourage mod authors to take use of such helpful features of createList.