I have currently have a table on a mobile app that has large currency values and I have a custom function that would change currency into abbreviations (B for billion, M for million, K for thousands).

On the table headers, I have a onclick event that sorts the column either from largest or smallest. However, the currency is not being formatted correctly as it is being recognized as a string. Is there a way to custom sort a column so that it can sort in the right way. For example, it should sort like this:


$17.4B

$6B

$2B

$100M

$15M

$200K

$1K



Hi!

You have to use the original currency field to sort the records, not the field with the result of your function.

Hope this help

Graça

Maria da Graça Peixoto wrote:

Hi!

You have to use the original currency field to sort the records, not the field with the result of your function.

Hope this help

Graça

What is the best way to do this? Have the custom field show, but internally sort with the numbers.


Yes. 

I don't have experience in mobile but in the web applications that is what I would do. 

Hello Edward,

I would calculate the full values in a new attribute the aggregate and sort it by that attribute. In the other column you got the values that you want to show in the screen. Like that you're able to sort it but hidding the "real" value that's behind the value you want to display on the screen.

I hope it helps! Cheers!