[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Rounding errors in financial app transforms

Subject: RE: Rounding errors in financial app transforms
From: "Abel Braaksma (online)" <abel.online@xxxxxxxxx>
Date: Fri, 27 Jul 2007 01:18:42 +0200 (CEST)
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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.