I have number greater than 10 digit and that stored as a text and I want sort them. I have tried with sortextarray() that is sorting based on ascii values so it is not giving me correct output. and I tried to convert into int but that is giving me infinity Please help me here to sort the array.
Thanks in advance.
Discussion posts and replies are publicly visible
Hi - it'll seem like a long way around but as along as you can guarantee all of your values only contain numerics (i.e. 0 thru 9) then you can:
If there's any danger that an individual item might not contain all numerics you can test for this whilst looking to cast an individual item and return, say, null to your output array, and then reject all of the null values in your output array.
Definitely like Stewart's approach the most.
a!localVariables( local!data: {"3504051867","350405187","350405188","350405189","3604051899","360405189"}, index( index( todatasubset( a!forEach( items: local!data, expression: a!map( decimalNumber: todecimal(fv!item), textNumber: fv!item ) ), a!pagingInfo( startIndex: 1, batchSize: -1, sort: a!sortInfo( field: "decimalNumber", ascending: false ) ) ), "data", {} ), "textNumber", {} ) )
...and you can be defensive here as well to exclude any value that inherently isn't a number...
Can You use this Approach in Readonly grid ?if yes can you help me out?
Yes, you can. Where are you stuck?