Deleting Numbers After the decimal point

Thrasher
09-02-2000, 09:57 AM
how do i delete numbers after the decimal point?

Example: 280/60 = 4.666 but after convertnig it to an integer, the result would be 5. What should i do so VB doesn't round off the number just delete the fractional numbers?

d.paulson
09-02-2000, 11:11 AM
You could use either int() or fix(). There is a difference between them when used with negative numbers.

d. paulson

amram71
09-02-2000, 11:30 AM
You could also use Str(), instr(), and left()
You would use instr to find the location of the "."
and left to get the text from 0 to the dot location -1

rallan
09-05-2000, 03:14 PM
The best way is to use ABS() check it out in help. It will give you the absolute value

amram71
09-05-2000, 05:38 PM
ABs Won't remove the decimal point

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum