Behavior of the SORT function
Posted: 11 Dec 2016 15:14
Hi,
I noticed that the luck function has behavior that I consider strange, because when I apply the function to sort a list of numbers the following occurs:
Case A ====================================================== =========
List before applying the SORT function (with numbers containing "."):
1,245.00
98.72
2450.78
87,25
4199.99
3509.99
3.509.99
3,314.99
3899.99
After applying the SORT function:
1,245.00
3,314.99
3.509.99
87,25
98.72
2450.78
3509.99
3899.99
4199.99
Case B ===================================================== ========
List before applying the SORT function (without numbers containing "."):
1245.00
98.72
2450.78
87,25
4199.99
3509.99
3509.99
3314.99
3899.99
After applying the SORT function:
87,25
98.72
1245.00
2450.78
3314.99
3509.99
3509.99
3899.99
4199.99
Looking at this behavior I came to the conclusion that the SORT function is not able to work with numbers in the format 0,000.00 (dotted number), it seems that it considers the number 1,245.00 as 1.25, since it considers 1,245.00 less than 87,25.
In Case B everything happens as expected.
Is this behavior of the function correct?
Thanks!
1
I noticed that the luck function has behavior that I consider strange, because when I apply the function to sort a list of numbers the following occurs:
Case A ====================================================== =========
List before applying the SORT function (with numbers containing "."):
1,245.00
98.72
2450.78
87,25
4199.99
3509.99
3.509.99
3,314.99
3899.99
After applying the SORT function:
1,245.00
3,314.99
3.509.99
87,25
98.72
2450.78
3509.99
3899.99
4199.99
Case B ===================================================== ========
List before applying the SORT function (without numbers containing "."):
1245.00
98.72
2450.78
87,25
4199.99
3509.99
3509.99
3314.99
3899.99
After applying the SORT function:
87,25
98.72
1245.00
2450.78
3314.99
3509.99
3509.99
3899.99
4199.99
Looking at this behavior I came to the conclusion that the SORT function is not able to work with numbers in the format 0,000.00 (dotted number), it seems that it considers the number 1,245.00 as 1.25, since it considers 1,245.00 less than 87,25.
In Case B everything happens as expected.
Is this behavior of the function correct?
Thanks!
1