Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Change dot with comma

  • Change dot with comma

    Posted by Michael Davydov on May 5, 2014 at 5:59 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?

    Thanks.

    Declan Smith replied 12 years, 3 months ago 2 Members · 1 Reply
  • 1 Reply
  • Declan Smith

    May 5, 2014 at 7:20 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;
    numstr.replace(“.”,”,”);

    Declan Smith
    https://www.madpanic.tv
    After Effects CS6/ FCS3 / Canon XLH1 / Canon 7D / Reason / Cubase

    “it’s either binary or it’s not”

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy