Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Return value from right of decimal point

Status
Not open for further replies.

Syerston

Programmer
Jun 2, 2001
142
GB
I need to check if a number has a vlaue to the right of the decimal point, and return that part of the number.

Any help as always greatly appreciated.
John
 
se:
right(sValue,len(sValue)-instr(sValue,"."))

where sValue is the string the the decimal point in it.

B
----------------------------------
Ben O'Hara
Home: bpo@RobotParade.co.uk
Work: bo104@westyorkshire.pnn.police.uk
Web: ----------------------------------
 
Ben

Thanks for replying

What you gave me works fine for returning the digits to the right of the decimal. However, if my calculation returns an integer(ie no decimal point) the function returns the value of the integer. Any ideas.
John
 
How about this: First use the Fix function to obtain the integer value of the number, then subtract that from your original value.

so:

ValueToRight = myValue - Fix(myValue)

Any good

Clare
 
Clare

Its not quite what I was looking for but with a tiny bit of tweaking I think it is going to work.

Thank you very much.
John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top