Don't use parseInt, because if you supply a number in scientific notation (e.g. a very large or very small number), it will convert to string first and this results in e.g. parseInt(2.08e-11) = 2 instead of 0.
Consider tweaking String.toNumber in enketo-xpathjs so it can convert "2.08e+3" to 2808, but check native XPath evaluator first.