ranwilli
Member
As long as all rows produce the same number of digits (see example below), the sort is accurate. However, if one or more rows ends up with a larger number, the sort is off (again - example below)
It seems I need a "format string", but I have no idea what to enter there.
example:
27
24
20
181
13
10
re-entering the columns that are calculated to change the list yields:
27
24
201
181
13
10
So it is clearly sorting as text... how do I display it as integers to make the sort correct?
here is the code from the field:
$en = '{fasttrack___enrollments}';
$enpt = ($en * 1);
$vanc = '{fasttrack___vandc_packs}';
$vancpt = ($vanc * 1);
$mk = '{fasttrack___member_kits}';
$mkpt = ($mk * 1);
$dir = '{fasttrack___directors}';
$dirpt = ($dir * 5);
$mt = ($enpt + $vancpt + $mkpt + $dirpt);
return (int)$mt;
Thanks in advance!
It seems I need a "format string", but I have no idea what to enter there.
example:
27
24
20
181
13
10
re-entering the columns that are calculated to change the list yields:
27
24
201
181
13
10
So it is clearly sorting as text... how do I display it as integers to make the sort correct?
here is the code from the field:
$en = '{fasttrack___enrollments}';
$enpt = ($en * 1);
$vanc = '{fasttrack___vandc_packs}';
$vancpt = ($vanc * 1);
$mk = '{fasttrack___member_kits}';
$mkpt = ($mk * 1);
$dir = '{fasttrack___directors}';
$dirpt = ($dir * 5);
$mt = ($enpt + $vancpt + $mkpt + $dirpt);
return (int)$mt;
Thanks in advance!