Format a number

K

Kimon

Hi,

I have a field (single with 2 digits) and i want to change the display, when
the number is e.g. 10.00 i want to display only the integer 10 (without the
..zeroes), and when then number is 12.23 to display the same number 12.23
 
D

Damon Heron

How about something like:

If Yournum = Int(Yournum) Then
Yournum.DecimalPlaces = 0
Else
Yournum.DecimalPlaces = 2
End If

Damon
 
Top