Solved

scientific notation

Posted on 2008-10-03
1
625 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
Comment Utility
         <xsl:when test="matches($atr, '^\-?[\d\.,]*[Ee][+\-]*\d*$')">
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

771 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