[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Rounding errors in financial app transforms
> 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|