This topic is locked

Sorting both numeric and Roman Numerals

1/26/2011 4:48:11 PM
PHPRunner General questions
vin7102 author

I have a sticker here. I have a field that contains company vehicle ID's and I need to sort the list page by this number. Only problem is that some of the vehicles' ID numbers are in roman numerals (ex. I, II, III, IV, V...) and others are just numbers.

Any ideas on how to tackle this one? My field is currently set as VARCHAR but I can change it.
Thanks

Vince

Sergey Kornilov admin 1/27/2011

I guess you cannot mix and sort roman numerals with Arabic ones. Probably you can get away adding one more field that would store normalized numeric values (Romans converted to numbers).
Just in case, here is the PHP class that converts Roman numerals to Arabic and back.

http://www.phpclasses.org/package/2442-PHP-Convert-numbers-between-Arabic-and-Roman-formats.html