Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in decimal conversion #15

Open
GoogleCodeExporter opened this issue Mar 19, 2015 · 1 comment
Open

Error in decimal conversion #15

GoogleCodeExporter opened this issue Mar 19, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
Decimal numbers between 0 and 1 is not converted into numbers.
Also negative numbers which aren't number! -01 is not converted into strings.

The following code fix the issue:

[not(string(number())='NaN' or 
 (starts-with(.,'0' ) and . != '0' and not(starts-with(.,'0.' ))) or 
 (starts-with(.,'-0' ) and . != '-0' and not(starts-with(.,'-0.' )))
)]

Original issue reported on code.google.com by jonaskro...@gmail.com on 19 Jan 2011 at 11:05

@GoogleCodeExporter
Copy link
Author

I found a problem with decimal numbers without fractional digits. 
<value>1.</value> results in "{value: 1.}". This additional line appends a zero 
to such numbers:

<xsl:if test="substring(., string-length(.))='.'">0</xsl:if>

Original comment by goo...@digineo.de on 11 Mar 2013 at 1:59

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant