问题
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.
回答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
回答2:
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.
来源:https://stackoverflow.com/questions/5266879/convert-exponential-format-into-numeric-format-in-xslt