![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Thanks in advance ... this one kind of through me. And your spelling threw me ![]() |

#3
| |||
| |||
|
|
You used the Round() function without a 2nd argument, so it rounds to a whole number. ? Round(1.5), Round(2.5) 2 2 Two equals two, so that's why the answer is True. The Round() function tends to round odd numbers up, and even numbers down. Statistically this removes the bias that would result from 5 values being rounded down (12345), but only four being rounded up (6789). You will see this pattern continue: ? Round(3.5), Round(4.5) 4 4 ? Round(5.5), Round(6.5) 6 6 In reality, the Round() function is subject to the rounding errors that always dog floating point numbers. For example, .545 rounded to 2 places should round down to .54 because the 4 is even: ? Round(.545,2) 0.55 The solution is to coerce the data type to Currency (fixed point) or Decimal (scaled) before rounding: ? Round(CDec(.545),2) 0.54 -- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users - http://allenbrowne.com/tips.html Reply to the newsgroup. (Email address has spurious "_SpamTrap") "John MacIntyre" <Please (AT) reply (DOT) to.group.thx> wrote in message news:KDWXa.1506$ZV6.200670 (AT) news20 (DOT) bellglobal.com... Can anybody explain the rule for this? Entered into the immediate window will give a result of TRUE. (Access 2000 SR1) ?Round( 1.5) = round( 2.5) True Thanks in advance ... this one kind of through me. -- John MacIntyre VC++ / VB / ASP / Database Developer http://www.johnmacintyre.ca |
![]() |
| Thread Tools | |
| Display Modes | |
| |