I have the strangest problem....
I have this application that creates an export intended for an erp system. This systems expects a decimal point (not a comma) and becuase we have international coworkers who have different regional settings I cannot rely on that beeing correct. So i created this function:
Thinking, this will allways put a point where needed. However for some reason it sometimes takes away one cent.
If I put in 8.17 it strangely returns 8.16
?makeamount(8.17)
8.16
I need to be able to handle any number ranging from 0.01 to 999999999.99
Has any one ever experienced anything alike? What is the solution?
I am stuck... I need a decimal point allways independant of regional settings, how can i do that?
Regards
p.s. No, Format does not work ....
I have this application that creates an export intended for an erp system. This systems expects a decimal point (not a comma) and becuase we have international coworkers who have different regional settings I cannot rely on that beeing correct. So i created this function:
Code:
Function MakeAmount(Amount As Double) As String
Dim x As String
x = Fix(Amount * 100) ' also tried using Int
If Len(x) = 1 Then x = "00" & x
If Len(x) = 2 Then x = "0" & x
MakeAmount = Left(x, Len(x) - 2) & "." & Right(x, 2)
End Function
If I put in 8.17 it strangely returns 8.16
?makeamount(8.17)
8.16
I need to be able to handle any number ranging from 0.01 to 999999999.99
Has any one ever experienced anything alike? What is the solution?
I am stuck... I need a decimal point allways independant of regional settings, how can i do that?
Regards
p.s. No, Format does not work ....
Last edited: