Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Adding text to number counter

Community Beginner ,
Apr 12, 2023 Apr 12, 2023

Hi 

I'm using the below expression for a number counter

 

 

var num = parseFloat(effect("Angle Control")("Angle"));
num.toLocaleString('en-GB', {maximumFractionDigits:0}) + "%";

 

 

I'd like to add the text (%) before the number rather than after if possible?

Thanks

TOPICS
Expressions
303
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 12, 2023 Apr 12, 2023

This should work:

var num = effect("Angle Control")("Angle").value;
"%" + num.toLocaleString('en-GB', {maximumFractionDigits:0})
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 12, 2023 Apr 12, 2023
LATEST

Perfect, thanks!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines