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

calculation problem

New Here ,
Jan 11, 2018 Jan 11, 2018

Hi everybody, I am using the following...

title.p.text = 'team1' +   Number(loadedData[1][10]) + Number(loadedData[1][11])) * 100 + ' ' + '%' ;

my problem is that the last part   (+ '%') is  not  working, I suppose that the numerical function has not been stoped, thats why I can not see %

any suggestions?

Regards

Pancho

745
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

correct answers 1 Correct answer

LEGEND , Jan 11, 2018 Jan 11, 2018

Why are you doing + ' ' + '%' instead of just + ' %' ?

In fact, why are you putting a space between the number and the percent sign at all? That's not normal formatting.

Anyway, you should be wrapping the entire math part of that code in parentheses.

Translate
Community Expert ,
Jan 11, 2018 Jan 11, 2018

Maybe the size of your text field is not big enough and the percent sign is being cropped off.

Try setting the text to only '%' or another small value and see if it works.

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
New Here ,
Jan 11, 2018 Jan 11, 2018

Hi JoãoCésar

actually I tried that already but it didn't work.

Thanks for answering

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 ,
Jan 11, 2018 Jan 11, 2018

Check if your font is embedded and if it can show special characters.

If you don't know how to do it, select your text field, open the Properties panel, go to Embed > Character ranges and check Punctuation or All.

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
New Here ,
Jan 11, 2018 Jan 11, 2018

I have every character already chosen, thanks for the answer. I almost sure that i need somehow to distinguish the mathematical functions from the %

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 ,
Jan 11, 2018 Jan 11, 2018
LATEST

It's really odd because I tried your code here and it works for me. The percent char appears normally.

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
LEGEND ,
Jan 11, 2018 Jan 11, 2018

Why are you doing + ' ' + '%' instead of just + ' %' ?

In fact, why are you putting a space between the number and the percent sign at all? That's not normal formatting.

Anyway, you should be wrapping the entire math part of that code in parentheses.

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
New Here ,
Jan 11, 2018 Jan 11, 2018

I was just trying to separate the % from the rest, normally I will have them together, but still it does not help

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