Gary.Maine wrote:
I need to make sure both versions are the same. I have yet to test OSX.
Both Linux and OSX return the same results.
Even if you change your number slightly...
Code: Select all
A.d =112345.994 ;<-- changed slightly for 2nd test
Debug A.d
Debug FormatNumber(A.d, 3)
B.d = A.d - 1
Debug FormatNumber(B.d, 3)
Debug B.d
Windows returns
112345.99400000001
112,345.994
112,344.994
112344.99400000001
and Linux and OSX return
112345.9940000000060535967350006
112,345.994
112,344.994
112344.9940000000060535967350006
One thing to note, both Linux and OSX are 64bit and return a much longer number.
Running the code on both Windows x86 and x64 return a shorter number when I would have expected Windows x64 to return the same as Linux and OSX.
I can only speculate that the numbers are slightly different because both Windows x64 and x86 compilers are handling the number as 32bit
Of course after you format the result for what you want the user to see, the results end up being all the same anyway.