Forum Discussion

patan's avatar
patan
New Contributor III
5 years ago
Solved

Using the parsed Float value in string

I have double value coming from the source as a string.
Source value:

“NTGEW” : “3.400”

I am using parseFloat() function to convert the string into double value.

parseFloat($NTGEW) ===> 3.4

The parseFloat function is working as expected when it is the only function as show above.

But if I use the same function with string concatenation it is appending the double value with trailing zeros as shown below:

“Input Value” + parseFloat($NTGEW) ===> “Input Value 3.400”

The expected value should be ===> “Input Value 3.4”

Any suggestions would be appreciated.floatIssue_2020_10_08.slp (4.8 KB)

  • Hi,

    Use the below expression in a mapper. After that use the Splitter snap to get the details.
    

    $Systems.map(x => {“Systems” : x.substring(x.indexOf(“(”)+1, x.indexOf(“)”))})