I have a Script Field called Value returning an integer representing the business value of a feature (the field is calculated based on other fields using Groovy). Its template is Number Field, the return type is int.
Unfortunately when using this field for sorting issues the order is lexicographic. What I need is to have proper integer comparisons and ordering.

Any idea about the possible cause?
Thanks,
Sam