Subject: RE: [xsl] Rounding errors in financial app transforms From: "Abel Braaksma (online)" <abel.online@xxxxxxxxx> Date: Fri, 27 Jul 2007 01:18:42 +0200 (CEST) |
> Bankers however round to n-1. That way I presume they get to make > more > money!! > > So if you try to round $100.105 to 2 decimal places you will get > $100.11 > whereas any financial system will (probably) expect $100.10. > Yes and no. No: bankers round to the nearest even digit. Yes: 100.105 becomes 100.10. And 100.115 becomes 100.12. And that is exactly what round-half-to-even does (like stated in my first post in this thread ;) See http://www.w3.org/TR/xpath-functions/#func-round-half-to-even, and consider this quote: "This function is typically used in financial applications where the argument is of type xs:decimal. For arguments of type xs:float and xs:double the results may be counterintuitive. For example, consider round-half-to-even(xs:float(150.0150), 2)." Cheers, -- Abel
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Rounding errors in financ, Justin Johansson | Thread | Re: [xsl] Rounding errors in financ, Justin Johansson |
Re: [xsl] Rounding errors in financ, Florent Georges | Date | RE: [xsl] Rounding errors in financ, Michael Kay |
Month |