Show Only the Decimal Part of a Number

  • Thread starter Thread starter djf
  • Start date Start date
D

djf

How can I only show the decimal part of a number? For example, if I have
1.234 I want to extract and show .234
 
hi,
How can I only show the decimal part of a number? For example, if I have
1.234 I want to extract and show .234
E.g.

[YourNumber] - CLng([YourNumber])


mfG
--> stefan <--
 
x = 1.234
= Format(X-Int(X),"#.####")

Note I have 4 # following the decimal. That is so you can get the precision
you want without following zeros.
 
Thanks. It works great.

Klatuu said:
x = 1.234
= Format(X-Int(X),"#.####")

Note I have 4 # following the decimal. That is so you can get the precision
you want without following zeros.
 
You can do it mathematically real easily. Round the number (1.234 to
-infinity) you'll get 1 and then 1.234 minus that 1 equals 0.234. Voila.
 
Back
Top