472,101 Members | 1,427 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,101 software developers and data experts.

Exponential Notation fails in format-number()

ashsa
45
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.0000000000000002E-2. This causes the xslt function format-number() to fail.
I use it as
Expand|Select|Wrap|Line Numbers
  1. <xsl:value-of select='format-number(8.0000000000000002E-2, "###,###.00")' />
The message says that
Expand|Select|Wrap|Line Numbers
  1. 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
Expand|Select|Wrap|Line Numbers
  1. <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..
Aug 20 '08 #1
3 7083
Just replacew those ###,### with "000,000".
This is produce the same effect.
Oct 7 '08 #2
Dormilich
8,658 Expert Mod 8TB
if I read the specs right, then exponential notation is not supported in XSL at all.

regards
Oct 7 '08 #3
jkmyoung
2,057 Expert 2GB
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:
http://www.baycongroup.com/learning_sql.htm
Oct 8 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Timothy Fitz | last post: by
5 posts views Thread by Neal Becker | last post: by
2 posts views Thread by Greg | last post: by
8 posts views Thread by pereges | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.