XPath in XQuery: Fractional Digits



XPath in XQuery: Fractional Digits


I have an output XSD that looks like this:



<xs:simpleType name="Money">
<xs:restriction base="xs:decimal">
<xs:fractionDigits value="2"/>
</xs:restriction>
</xs:simpleType>


From this I use a statments



fn:sum($Accounts/in:IndividualAcct[in:AcctType = 'AttcRec']/in:balance * in:amount)


But my summation to a field defined witht the definition above appears as:



36745.770000000004


What I am looking for is only 2 fractional digits


So I am wondering, can I use something like a format-string or fn:string


If so, can I combine this with my previous fn:sum string listed above


What would that look like?


Thanks


No comments:

Post a Comment