[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

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


Subject: Re: [xsl] NaN : How to Replace comma as decimal to avoid NaN
From: Martin Honnen <Martin.Honnen@xxxxxx>
Date: Tue, 09 Sep 2008 14:46:11 +0200

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/


Current Thread