Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

XPath in XQuery:  Scientific notation

Posted on 2015-01-21
1
Medium Priority
?
309 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
[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 2000 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

Learn by Doing. Anytime. Anywhere.

Do you like to learn by doing?
Our labs and exercises give you the chance to do just that: Learn by performing actions on real environments.

Hands-on, scenario-based labs give you experience on real environments provided by us so you don't have to worry about breaking anything.

Question has a verified solution.

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

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Suggested Courses

715 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