Added Decimal Places
Why is Voiceflow adding decimal places when saving JSON data to a variable? More importantly, how do I fix it?
This is product review data. There is no need for more than one decimal place.

1 Reply
Solved. Anyone facing the same issue can create a second variable for the rounded value then place this JavaScript in a block to show the rounded result:
// parse the incoming string (or number) into a float
const raw = parseFloat(VARIABLE HERE);
// round to exactly one decimal place and store as a string
NEW VARIABLE HERE = raw.toFixed(1);