truncating decimal on numbers

  • Thread starter Thread starter cj
  • Start date Start date
C

cj

I want 7 * .105263 to result in an int32 value of 0. and 7 * .189021 to
result in an int32 value of 1.

I don't want to round. How can I just drop the decimal places?
 
never mind--I knew as soon as I asked I'd find the answer. Sometimes
I'm tempted to ask just because I know I'll find the answer as soon as I
hit send.

Int or Fix is what I wanted.
 
cj said:
I want 7 * .105263 to result in an int32 value of 0. and 7 * .189021 to
result in an int32 value of 1.

I don't want to round. How can I just drop the decimal places?

Check out 'Fix', 'Int', and 'Math.Floor' and 'Math.Ceil'.
 
CJ,

You can always use it as string and than cut the decimals you don't want
using the IProvider from ToSring. Is as well an easy way to round in any way
you want.

CJM
 
Back
Top