This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Calculate mantissa and exponent?


Edward,

Have you looked into using the format-number function?

you could do something like ...

  <xsl:value-of select="format-number(12345, '##0.####E0') />

for an output of 1.2345E4

More info in contained in MK's book (XSLT Programmer's Reference) pp455-459
(First Edition)

It would also be useful to look into xsl:decimal-format to find more about
the display of numbers,

Regards, Tim Watts

> -----Original Message-----
> From: owner-xsl-list@lists.mulberrytech.com
> [mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of Mitchell,
> Edmund
> Sent: Thursday, 9 August 2001 10:19 PM
> To: 'xsl-list@lists.mulberrytech.com'
> Subject: [xsl] Calculate mantissa and exponent?
>
>
> Hello all,
> I have to calculate a numbers' mantissa and exponent.
> So if I have 123456, it should be normalized as 1,23456e+5.
> Unfortunately, I have to use only pure xsl, no extension functions or
> scripts are allowed.
> XSLTSL & EXSLT don't seem to have this functionality.
>
> To avoid re-inventing the wheel, has anyone solved this before?
>
> Thanks,
>
> Edmund
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]