Truncating after the Decimal

  • Thread starter Thread starter jegrau
  • Start date Start date
J

jegrau

Is there any way to set up a field so you only get two decimal places either
by coding or properties?

I have a field that converts hours to work months.

My Code: WorkMonthsUsedTL = HoursUsedTL / 174

Form entry HoursUsedTL 8

Result: 4.59770114942529E-02


--
John E. Grau
IT Specialist
Bureau of Land Managment
Miles City Field Office
Miles City MT 59301
(e-mail address removed)
 
Is there any way to set up a field so you only get two decimal places either
by coding or properties?

I have a field that converts hours to work months.

My Code: WorkMonthsUsedTL = HoursUsedTL / 174

Form entry HoursUsedTL 8

Result: 4.59770114942529E-02

I'd suggest explicitly rounding in the code:

WorkMonthsUsedTL = Round(HoursUsedTL / 174, 2)

Alternatively you could Dim WorkMonthsUsedTL as a Decimal, specifying two
decimal places.
 
Back
Top