Sort Numbers as Numeric
Kelly Burgess
kellyb at montana.com
Sat Jun 12 11:47:21 UTC 2021
Hi Mike,
> I have a list of values in a character field like this.
>
> A1
> 2
> 1
> B2
> 20
> 12
>
> It Sorts like this.
>
> 1
> 12
> 2
> 20
> A1
> B2
>
> I want it to sort like this.
>
> 1
> 2
> 12
> 20
> A1
> B2
Instead of the normal sort, say with Do list.$define(val)...
# Do list.$sort($ref.val,kFalse)
prepend some zeros to the value and sort that:
Do list.$sort(jst($ref.val,'-3P0'),kFalse)
Kelly
More information about the omnisdev-en
mailing list