Solved

scientific notation

Posted on 2008-10-03
1
640 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

WordPress Tutorial 1: Installation & Setup

WordPress is a very popular option for running your web site and can be used to get your content online quickly for the world to see. This guide will walk you through installing the WordPress server software and the initial setup process.

Question has a verified solution.

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

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
It's sometimes a bit tricky to use date functions in Oracle BPEL. I'll explain quickly how you can add N days to the current date. In a BPEL process this can be useful, and you can adapt it to fit your needs. First of all, let's see how to add 1 …
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:
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

632 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