Saturday, August 18, 2018

exponential notation to integer notation XSLT2.0

IS it possible to change the following exponential notation to integer notation using XSLT 2.0.

2.0151109001E10 to 20151109001

I tried with

number(2.0151109001E10)

but it gives NaN as answer.

EDIT: XSLT:




OUTPUT:

 2.0151109001E10
 2.0151109001E10
 2.0151109001E10

The following works out


Solved

The real problem with your input is not the exponential notation, but the use of a comma as the decimal mark. XML only recognizes a period as the decimal mark.

Try something like:


or:



You can try to put them inside the single quotes '' like this:

number('7.2345E7')

gives

72340000

You can use format-number:

format-number(2.0151109001E10, '#')

No comments:

Post a Comment