Solved

XPath in XQuery:  Scientific notation

Posted on 2015-01-21
1
208 Views
Last Modified: 2015-01-21
XPath in XQuery:  Scientific notation

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


I then use the following statement:

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

Open in new window


One of my summations results in the following in scientific notation:

1.08531525E6

Open in new window


I need to format this in such a way as to NOT use
scientific notation.  

Can I use either fn:string or format-string().  

How can I do this?   Can I do this all on the same line as the fn:sum() statement.  What would that look like?

Thanks
0
Comment
Question by:Anthony Lucia
1 Comment
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 500 total points
ID: 40563179
you need format-number() to get rid of the scientific notation

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

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
The viewer will learn how to implement Singleton Design Pattern in Java.

747 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now