Select only the portion of a number to the right of a decimal point

  • Thread starter Thread starter Karl
  • Start date Start date
K

Karl

I want to select the portion of a number in a field to the
right of the decimal point. I can do this using
the "Right" function however if the portion to the right
of the decimal is a "0" the "Right" function returns the
whole number. ("Right" function selecting 2 digits)

eg. Field1=10.3 Text1=Right([Field1],2)
Return of the "Right" function = .3

However, If Field1=10.0
Return of the "Right" function = 10

Desired result would be .0

Thank you,
 
Karl,

Numbers are not text strings, don't treat them as such... use simple maths
instead!
DecimalPart = [Field1] - Int([Field1]

HTH,
Nikos
 
-----Original Message-----
Karl,

Numbers are not text strings, don't treat them as such... use simple maths
instead!
DecimalPart = [Field1] - Int([Field1]

HTH,
Nikos

I want to select the portion of a number in a field to the
right of the decimal point. I can do this using
the "Right" function however if the portion to the right
of the decimal is a "0" the "Right" function returns the
whole number. ("Right" function selecting 2 digits)

eg. Field1=10.3 Text1=Right([Field1],2)
Return of the "Right" function = .3

However, If Field1=10.0
Return of the "Right" function = 10

Desired result would be .0

Thank you,


.
Thank you!!!
 
Back
Top