Solved

scientific notation

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

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying 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
TripAdvisor Widgets on WordPress Websites 10 309
Optimum versions of Selenium Webdriver with Python On Windows 7 1 205
Re-position the objects 7 132
Randomize in Owl Carousel v1.3.2 6 132
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…
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

734 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