mobile databases, mobile forms, and mobile synchronization … where you need to work
Providing Pocket Access, Mobile Database, Windows CE Database, and Windows CE Development Solutions

Tip of the Month (August 2001)

Controlling the Number of Decimal Places Displayed

When you display a numeric value using a Visual CE form, you may want to
control how many digits are shown to the right of the decimal point. You
can do this by selecting the appropriate datatype and setting the Money flag
correctly.

By default, integer values are shown without any decimal digits. If the
"Money" property is on, the value is divided by 100 and is shown with two
decimal places.

By default, floating point values are shown with six decimal digits. If the
"Money" property is on, the value is rounded to two decimal digits.
If you wanted to remove all the decimal digits in the value, you could use
the expression:

      @left(@var(45), @length(@var(45))-7)

(assuming, of course, your value is in @var(45))

(also see the June 2006 tip of the month)