Post
by WaltBrown » Sun Apr 12, 2015 9:19 am
This might be a bug. I looked at a few descriptions of financial rounding and it should probably round up if the preceding number is odd and round down when it is even ("rounding to even"), in the case of a tie-breaker (ie "5"). LC seems to always round down the absolute value (ie 65 rounds to 60, and -65 rounds to -60). I think that financially (at least based on what I read - consult a GAAP expert to verify), 65.55 should round to 65.6 and 65.45 should round to 65.4. I couldn't find any info on negative financial values, but I assume the same odd/even rule would apply.
It could just be seen as a documentation bug - instead of "financial" rounding ("rounding half to even"), it is doing "rounding half to zero" (good discussion in Wikipedia on "Rounding" - also indicates this is actually an option in most math libraries).
Maybe we need a property of "roundingHalfStyle" - default to "roundHalfToEven" as a default would match the documentation (and what I could find on financial sites), alternates could be "roundHalfToOdd", "roundHalfUp", "roundHalfDown", "roundHalfToZero", and "roundHalfToInfinity".
Walt Brown
Omnis traductor traditor