Exponential Notation fails in format-number()

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ashsa
    New Member
    • Feb 2007
    • 45

    Exponential Notation fails in format-number()

    Hi everyone,
    I am trying to display a numeric value fetched from an sql server table which is stored in the exponential notation. For eg, 0.08 is getting stored in the table as 8.0000000000000 002E-2. This causes the xslt function format-number() to fail.
    I use it as
    Code:
    <xsl:value-of select='format-number(8.0000000000000002E-2, "###,###.00")' />
    The message says that
    Code:
    This name may not contain the '#' character: -->#<--##,###.00 -->format-number(8.0000000000000002E-2, "###,###.00")<--
    I searched for an xsl function so that I would use it like
    Code:
    <xsl:value-of select='format-number(number(8.0000000000000002E-2), "###,###.00")' />
    To my disappointment no numeric function handles the exponential notation. Any help will be greatly appreciated.

    Many thanks in advance..
  • harshhg
    New Member
    • Jul 2008
    • 1

    #2
    Just replacew those ###,### with "000,000".
    This is produce the same effect.

    Comment

    • Dormilich
      Recognized Expert Expert
      • Aug 2008
      • 8694

      #3
      if I read the specs right, then exponential notation is not supported in XSL at all.

      regards

      Comment

      • jkmyoung
        Recognized Expert Top Contributor
        • Mar 2006
        • 2057

        #4
        Sanitize your output from the SQL side. Can we see the query that you're using?
        If you use a number mask, it would help. Eg see:

        Comment

        Working...