Hi,
I do a operation that return a number like x.xxxxx... and I only want to keep x.xx (2 number of precisio nafter the commat). I suppose there is a simple function like in C# to do that ?
Thanks for help
Printable View
Hi,
I do a operation that return a number like x.xxxxx... and I only want to keep x.xx (2 number of precisio nafter the commat). I suppose there is a simple function like in C# to do that ?
Thanks for help
VB Code:
Dim x As Double x = 5.685698458945 x = System.Math.Round(x, 2) MsgBox(x)
Thanks you
exactly right but just be aware that the round method uses bankers rounding and always rounds to an even last digit, which can casuse edless problems when users check your maths and tell you it does not agree with their own calculations.