Re: Rounding to nearest 1000
- From: "Gary Walter" <garylwpullease@xxxxxxxxxxxxxxxx>
- Date: Tue, 22 Aug 2006 08:00:33 -0500
Hi John,
Maybe irrelevant to poster,
but both will produce banker's rounding...
gary
"John Spencer" wrote:
CInt is not the same as Int.limited
CInt rounds the number to the nearest whole number value (using bankers
rounding).
Int truncates the number - returns just the integer portion.
One change to Ken Snell's suggestion: I would use CLng since CInt is
to handling numbers in the range 32267 (plus or minus).3,
"Darrell" <dcyphers@xxxxxxx> wrote in message
news:u0Kk7daxGHA.3788@xxxxxxxxxxxxxxxxxxxxxxx
Ken Snell (MVP) wrote:
CInt(YourNumber / 1000) * 1000
Thank you, Ken. The only catch is that, unless I misunderstand this, I'm
going to get the next LOWER 1000, rather than the NEAREST 1000. If
MyNumber is 3900, dividing by 1000 will give me 3.9. CInt will give me
caseand multiplying by 1000 will give me 3000. What I would like in this
is 4000.
Darrell
.
- References:
- Rounding to nearest 1000
- From: Darrell
- Re: Rounding to nearest 1000
- From: Ken Snell \(MVP\)
- Re: Rounding to nearest 1000
- From: Darrell
- Re: Rounding to nearest 1000
- From: John Spencer
- Rounding to nearest 1000
- Prev by Date: Re: Update table with SQL
- Next by Date: Re: SQL Code Error
- Previous by thread: Re: Rounding to nearest 1000
- Next by thread: Re: Rounding to nearest 1000
- Index(es):
Relevant Pages
|