Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scientific Notation

Status
Not open for further replies.

simonchristieis

Programmer
Jan 10, 2002
1,144
GB
I have a value - over 1,000,000 or less than 0.000001 and I want to output it (via xslt 2.0) as it's decimal value rather than the exponential that is being displayed.

Any ideas if there is a way to do this, is there a simple way to achieve this eg:

<xsl:value-of select="xs:decimal(xs:double('1.23E6'))"/>

Using saxon parser.

Regards

Simon
 
Maybe this is what you meant?
[tt] <xsl:value-of select="format-number('1.23E6', '#,###.######)"/>[/tt]
Or alike. In any case, usually it would be using format-number() xslt function.
 
amendment
A missing quote.
[tt] <xsl:value-of select="format-number('1.23E6', '#,###.######[red]'[/red])"/>[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top