xsl-list
[Top] [All Lists]

Re: [xsl] NaN : How to Replace comma as decimal to avoid NaN

2008-09-09 08:46:44
Sathasivam, Elayaraja wrote:
sum ($accs/FUNum/@Granted)  = 0

$divideBy = 1,750099

Result: <xsl:value-of select="sum ($accs/FUNum/@Granted)  div $divideBy"/>

Expected Output: 0
Actual Output: NaN

Please note the value of divideBy contains comma(,) instead of decimal(.)

Assume we need to replace the comma as decimal. Not sure how to handle this. 
Since by reading the configuration file will get the value of divideBy, it has 
only comma instead of decimal.

How to avoid NaN.

Use
  translate($divideBy, ',', '.')

--

        Martin Honnen
        http://JavaScript.FAQTs.com/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>