I start with a number, obtain its integer, convert the integer to a string and then return the length of the string:
Here is my example:X=9980.76
NumberFormat (9980.76,0,0).length yields 5. Why am I getting 5 when it should be 4?
The integer of X is 9980. Then the length of the rounded X is 4.
When I perform the same operation on X=12.689 , NumberFormat (12.689,0,0).length , the result yields a length =2 which is correct. I am puzzled with these conflicting results after spending hours trying to figure this out. Any help or a better approach to the problem is highly appreciated.
Thank you
Here is my example:X=9980.76
NumberFormat (9980.76,0,0).length yields 5. Why am I getting 5 when it should be 4?
The integer of X is 9980. Then the length of the rounded X is 4.
When I perform the same operation on X=12.689 , NumberFormat (12.689,0,0).length , the result yields a length =2 which is correct. I am puzzled with these conflicting results after spending hours trying to figure this out. Any help or a better approach to the problem is highly appreciated.
Thank you