Skip to main content
Participating Frequently
November 16, 2022
Question

After Effects Countdown Komma für Dezimalstellen

  • November 16, 2022
  • 1 reply
  • 1573 views

Hallo zusammen

 

Ich erstelle gerade ein Balkendiagramm mit Zahlen, die von 0 bis 9,7 zählen. Nun hab ich rausgefunden, wie ich bei Tausender den Punkt als Hochkomma anpassen kann. Hab aber noch nicht herausgefunden, wie ich für die Dezimalstellen anstelle eines Punktes (7.9) eine Komma setzen kann (7,9).

 

Ich hab diesen Code im Moment drin:

 

s = "" + (effect("Einstellungen für Punkte")("Punkt")[0]) .toFixed(1) + ""; s.replace(/\B(?=(\d{3})+(?!\d))/g, ",");

 

Vielen Dank schon im Voraus für eure rasche Hilfe.

 

Liebe Grüsse

Nicole

This topic has been closed for replies.

1 reply

Community Expert
November 17, 2022

Try this:

v = effect("Slider Control")("Slider").value;
s = v.toFixed(1);
n = s.replace(/\B(?=(\d{3})+(?! \d))/g, ",");
n.toString().replace(".", "˛")

Replace the "v" variable with your point controller. 

 

Or you can try just adding the last line of the code to yours like this:

s = "" + (effect("Einstellungen für Punkte")("Punkt")[0]) .toFixed(1) + "";
s.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
s.toString().replace(".", "˛")

The "" + (effect... and the + "" do not really do anything.

Participating Frequently
November 24, 2022

Thank you very much! It worked! 🙂