I'm using Pentaho Data Integration and I need to convert the string value content in a variable named "density" in a numeric value.
For example if density = "6.5" I need to transform it in "6,5".
I've tried this Javascript code
var density = "6.5";
var num_density = parseFloat(density.replace(",", "."));
But it doesn't work and the error is
org.mozilla.javascript.UniqueTag cannot be cast to java.lang.Number
I think that is related to PDI uses the Rhino engine but I don't know how to solve or find an alternative way.
Any suggestion will be appreciated
It work as normally my friend.