Solved

XPath in XQuery:  Scientific notation

Posted on 2015-01-21
1
237 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 Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
V.simple question about Android packages and libraries 1 29
SHA2 certs for IIS AND Java? 2 113
Desingning Refactoring existing code 2 26
write xml in vb.net 2 33
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
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 will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
The viewer will learn how to implement Singleton Design Pattern in Java.

837 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