-
Keep First Decimal Zero in Counter
Hi Guys,
I’m working on a bar chart that calculates the % of change between two values in the chart. Everything works fine except whenever the tenths place = 0, it disappears. For example, 2.0 becomes 2
I’d like to keep that zero. Here’s the expression as I have it written so far; it’s in the “Source Text” parameter of a text layer.
var valueA = thisComp.layer( index + 5 ).effect(“Value Control”)(“Slider”);
var valueB = thisComp.layer( index + 3 ).effect(“Value Control”)(“Slider”);
var valueDifference = (valueB – valueA);
var divideChange = clamp(valueDifference / valueB, -9.99, 9.99)if (valueDifference < 0) {
displayValue = Math.round(divideChange*1000) / 10 + “%”
} else {
displayValue = “+” + (Math.round(divideChange*1000) / 10 + “%”)
}
displayValue