|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: XSLT 2.0 Decimal number silliness
# Two possibilities. One is to allow some way to specify # default number of fraction digits in the absence of a schema. # Another is to implement a fixed precision and document it. # I have chosen to implement 18 integer digits plus 18 fraction # digits. I believe this is legitimate according to the spec # (tell me if I'm wrong), and it's a whole lot easier to # explain to users. Plus, you get exactly the same answers no # matter how you calculate two-thirds in my examples below. The schema spec says that a total of 18 digits in total is sufficient (both for xs:integer and for xs:decimal). However, xs:unsignedLong requires 20 digits, and that's derived by restriction from xs:integer, so I don't know where the 18 came from. My implementation is using infinite precision for xs:decimal, which is why I have to make some kind of cut-off on division. Another option I considered was to keep max(18, M, N) significant digits where M and N are the number of significant digits in the operands. I tend to agree with you that I would much rather have an interoperable spec on this. However, some of the XQuery vendors push hard against this, especially those who are trying to translate XPath predicates into SQL predicates. Michael Kay
|
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
|

Cart








