Droping the decimal

# Thread: Droping the decimal

1. Senior Member
Join Date
Dec 1969
Posts
213

## Droping the decimal

How do you take a number and drop the decimal place, with out rounding? I have a math equation that sometime returns a number with a decimal place but need it to drop. So if the number was 5.1564 I need 5 returned or if it was 6.98765 I need 6 returend. I know abou the round() function but I don&#039;t want to round the numbers.

2. Senior Member
Join Date
Dec 1969
Posts
111

## RE: Droping the decimal

There are a few ways. Here is one<BR>&#060;%<BR>myvariable = 5.5576<BR>nodecimal = Split(myvariable,".")<BR>%&#062;<BR>&#060;%=nodeci mal(0)%&#062; ... result returned should be 5

3. Senior Member
Join Date
Dec 1969
Posts
497

## int()

int converts the number to an integer (w/o rounding)<BR><BR>&#060;%<BR>myvariable = 5.5576<BR>nodecimal = int(myvariable)<BR>%&#062;<BR>&#060;%=nodecimal&#0 62;

4. Senior Member
Join Date
Dec 1969
Posts
111

## RE: int()

Yeah ... that&#039;s a better way.

5. Senior Member
Join Date
Dec 1969
Posts
213

## Thanks

Thanks.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•