Pentaho Data Integration: convert a text in number (Rhino)

172 Views Asked by At

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

1

There are 1 best solutions below

0
VietnamDataEngineer On

It work as normally my friend. enter image description here