I have a function,

Public Function toTwoDecimals(x As Double) As Double
toTwoDecimals = (Format(x, "0.00"))
End Function


it reduces decimals to only two decimal places. Thats ok but if you get an answer like 123.30 it prints it out as 123.3. I was just wondering if anbody knew some code to put in the function so i will get the 0 as well?

I thought that if I added in the code below it would work, but it didn't:

IIf((x * 100) Mod 10 = 0, x & "0", x)

Thanks!