![]() | |
![]() |
| | Thread Tools | Display Modes |
#11
| |||
| |||
|
|
Hi Shadenfroh I understood Peter to mean that trailing zeroes were significant for the purpose of identifying the digits on which to perform the round function. I do not understand why he would need to leave the trailing zeroes in the result, since 5.00023 = 5.0002300. Where my calc does fall down is on whole numbers (returned ?), and negative numbers (rounding up instead of down and down instead of up), both easy enough to fix. My revised calc: If(Int(Number) = Number, Number,Left(Number, Position(Number, ".", 1, 1) - 1) & Abs(Round(TextToNum(If(Number < 0, "-.",".") & Right(Number, Length(Number) - Position(Number, ".", 1, 1))),SignificantDigits)) / TextToNum(Left("10000000000000000000", Length(Right(Number, 1 + Length(Number) - Position(Number, ".", 1, 1))) - Length(NumToText(TextToNum(Right(Number, Length(Number) - Position(Number, ".", 1, 1)))))))) Bridget Eley in article hetZa.5162$M6.376337 (AT) newsread1 (DOT) prod.itd.earthlink.net, Shadenfroh at shadenfroh (AT) yahoo (DOT) com wrote on 11/8/03 1:09 AM: F'rinstance, 5.00023000999 calculates to 5.00023 instead of 5.0002300 From Peter's post, "As to the seeming contradiction: I initially indicated that *leading* zeroes (0 before the first non-zero digit) were insignificant, but *trailing* zeroes (zero after the 3rd non-zero digit) were not." |
#12
| |||
| |||
|
|
"Rounding" means finding the nearest, most reasonable approximation. As 7.6 (not your example) is "towards" 8, while 7.4 is "towards" 7, so is -7.6 approximated by -8, and -7.4 by -7, (-7.4) being closer to -7 than to -8. The "middle ground" of 7.5 is arbitrarily rounded up stilll, I think, except over large sets of values where it may be alternated up and down to average out differences (?)? |
|
Where my calc does fall down is on whole numbers (returned ?), and negative numbers (rounding up instead of down and down instead of up), both easy enough to fix. |
![]() |
| Thread Tools | |
| Display Modes | |
| |