0

I have to convert within my XSLT number in exponential format ( i.e: 1,2345E7 ) into numeric ( i.e: 12340000 ). What would the a XSLT function to achieve this.

Daniel
  • 165
  • 3
  • 12
  • Exact duplicate [Formatting scientific number representation in xsl](http://stackoverflow.com/questions/4367737/formatting-scientific-number-representation-in-xsl) –  Mar 11 '11 at 18:08
  • Check my succinct implementation. –  Mar 11 '11 at 18:09
  • I think the answer is here: http://stackoverflow.com/questions/4367737/formatting-scientific-number-representation-in-xsl – Katsifaris Jul 06 '15 at 10:11

2 Answers2

1

I haven't tried it, but this implementation claims to do what you ask: http://www.orm-designer.com/article/xslt-convert-scientific-notation-to-decimal-number

James Sulak
  • 31,389
  • 11
  • 53
  • 57
0

XSLT 2.0 accepts exponential notation for numbers on input, XSLT 1.0 does not. So the answer rather depends which version you are using (I suspect you are using 1.0, because otherwise you wouldn't need to ask for help). On the output side, you can control the format using format-number() with either version.

Michael Kay
  • 156,231
  • 11
  • 92
  • 164
  • I am using XSLT 1.0 and need to convert from exponential to numeric since the program that uses thoe XMLs does not support exponential format – Daniel Mar 11 '11 at 00:01
  • +1 Good answer. @Daniel: question is unclear about whether you have such notation in input source or you want this for your output. –  Apr 05 '11 at 00:10