I want to display a number in a textbox within an excel form. report, however I only want to show any decimal points if they are present and the I only want to show 2 decimal places.
e.g. if the number is 12 then I want to show 12
If the number is 12.1 then I want to show 12.10
If the number is 12.126 then I want to show 12.13
At the moment i have the below code and it is not showing me decimal points:
Me.Amount.Value = Format(Me.Amount, "#,###")
You could write a function to conditionally return one of two format strings: