cancel
Showing results for 
Search instead for 
Did you mean: 

toString() is giving unexpected output

Akash_Srivastav
New Contributor II

A field is coming as a number from source and we want to convert it to string, but the output format is different for some records. Follwoing 4 records have WSH value of 0 but after toString(), out is ‘0’ for 2 records and ‘0.0’ for the other 2

image

2 REPLIES 2

tstack
Former Employee

You might want to use the toFixed() method. That will give you more control of what the resulting string looks like.

Thanks!!. it worked