isolate the cents value in a currency amount

  • Thread starter Thread starter Sharon
  • Start date Start date
S

Sharon

How do you isolate the cent amount in a field. For
example, we want to pick up the .01 or 40 in the following
figures: We tried rtrim, however, it picked up the
decimal point on the figure with .40.

12254.01 or 12255.40
 
-----Original Message-----
How do you isolate the cent amount in a field. For
example, we want to pick up the .01 or 40 in the following
figures: We tried rtrim, however, it picked up the
decimal point on the figure with .40.

12254.01 or 12255.40
.
12254.01-int(12254.01)
 
A number of different ways:

(100*YourField) Mod 100

or

CInt((YourField - Int(YourField)) * 100)

You can treat the currency as Text and then get the last 2 characters using:

Right(Format([YourField], "0.00"), 2)

but I think the using mathematical cals is the more correct way to do this.
 
I like Van's first idea. If you want to convert it back
to decimals you could add * .01 on the end. Format it as
a 2 decimal number and you'll have what you're looking for.

((100*[centisolation]) Mod 100)*0.01
 
Back
Top