-
Comma instead of dot – javascript
Hello,
I need to transform the “dot” in a “comma” in this expresion used in a Bar Graph.
I’ve tried to put “.toLocaleString(‘de-DE’)” before and after this line – “.toFixed(textNumOfDecimals” but it doesn’t work – or i don’t do it correctly.
If i change “.toFixed(textNumOfDecimals” to “.toLocaleString(‘de-DE’)” it works but i’ve lost decimals… so it doesn’t help me.
Sorry for my english is not my first language, and thanks in advance for help!
const textValue = thisComp.layer(“CONTROLS”).effect(“Text – Animated Value”)(1).value;
const textNumOfDecimals = thisComp.layer(“CONTROLS”).effect(“Text – Number of Decimals”)(1).value;
const textHigh = thisComp.layer(“CONTROLS”).effect(“Text – High Limit”)(1).value;
const textLow = thisComp.layer(“CONTROLS”).effect(“Text – Low Limit”)(1).value;
const textSize = thisComp.layer(“CONTROLS”).effect(“Text – Size”)(1).value;
thisLayer.text.sourceText.style
.setText(thisLayer.clamp(textValue, textLow, textHigh).toFixed(textNumOfDecimals) + “%”)
.setFontSize(textSize)