# Thread: Keep Cint from rounding

1. ## Keep Cint from rounding

Hey All,

Is there a way to keep Cint from rounding ?

Thanks
Mrv

2. ## Re: Keep Cint from rounding

what is that you wish to do? do elaborate

3. ## Re: Keep Cint from rounding

So you want to convert some decimal number to an integer but just lop off the decimal rather than round?

Could do some integer division(\).
a=2.5\1
'a' would be 2

Actually you can just use the int() and/or fix() function which will truncate for you. The Help file on Cint() references those.

4. ## Re: Keep Cint from rounding

sure:

a = 12.75

b = Int(a)
OR
b = Split(a,".")(0)
OR
b = Left(a, InStr(a,".")-1)

NOTE: b = Left(a, InStr(a,".")-1)

will fail if a is an integer.

[ QUOTE ]
Hey All,

Is there a way to keep Cint from rounding ?

Thanks
Mrv

[/ QUOTE ]

5. ## Re: Keep Cint from rounding

Fixed..

Got cell data = 7.9

Watch showed "7.9", string

Used CInt

Watch showed 8

Thanks for respones

mrv

#### Posting Permissions

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

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.