Solved

XPath in XQuery:  Fractional Digits

Posted on 2015-01-21
1
87 Views
Last Modified: 2015-01-21
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>

Open in new window


From this I use a statments

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

Open in new window


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

36745.770000000004

Open in new window


What I want is for this to display 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
0
Comment
Question by:Anthony Lucia
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 500 total points
ID: 40563080
you need format-number()

format-number(cfn:sum($Accounts/in:IndividualAcct[in:AcctType = 'AttcRec']/in:balance * in:amount), '0.00')
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This video teaches viewers about errors in exception handling.

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question