ADOBE AFTER EFFECTS: Forum Expressions Tutorials Podcasts Creative Cloud

Change dot with comma

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Michael DavydovChange dot with comma
by on May 5, 2014 at 5:59:04 pm

I have a simple code, showing an animated Slider number in a text field. It is a number with a floating point, like 29.3. And now I was asked to replace DOT with COMMA, to make it look like 29,3, and I don't know how to do it.

What is the right way to replace dot with comma in that matter?


Return to posts index

Declan SmithRe: Change dot with comma
by on May 5, 2014 at 7:20:54 pm

Use the replace method of the string representation of the number.
For example:

numStr = "" + 12.35
numStr.replace(".", ",")

So if your text field is something like:

thisComp.layer("Control").effect("Slider Control")("Slider")

Change it to read

numstr="" + thisComp.layer("Control").effect("Slider Control")("Slider").value;

Declan Smith
After Effects CS6/ FCS3 / Canon XLH1 / Canon 7D / Reason / Cubase

"it's either binary or it's not"

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2016 All Rights Reserved