Solved

scientific notation

Posted on 2008-10-03
1
633 Views
Last Modified: 2013-11-18
Hi experts,

The following code is trying to remove the scientific notation. However, it fails to do so for negative values, such as -2.5e-3

How do I revised the code? Thanks
----------------------------------------------
<xsl:function name="fn:remove-scientific-notation">
        <xsl:param name="atr" />
        <xsl:choose>
            <xsl:when test="matches($atr, '^[\d\.,]*[Ee][+\-]*\d*$')">
                <xsl:value-of
                    select="format-number(number($atr), '#0.#############')">
                </xsl:value-of>
            </xsl:when>
            <xsl:otherwise>
                <xsl:value-of select="$atr"></xsl:value-of>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:function>
0
Comment
Question by:meow00
1 Comment
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 350 total points
ID: 22637589
         <xsl:when test="matches($atr, '^\-?[\d\.,]*[Ee][+\-]*\d*$')">
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

When you work with shopping cart / ecommerce relates web sites, you need to pass the certain form post details to the payment gateway process page with required details for the products items you give to order. Also you may need to track the ordered…
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
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:

815 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

11 Experts available now in Live!

Get 1:1 Help Now