News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

2.1 Suggestion for Subs-List.php...

Started by Matthew K., April 02, 2016, 03:56:47 PM

Previous topic - Next topic

Matthew K.

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.

Advertisement: