You are not logged in.

shinji

Beginner

  • "shinji" started this thread

Posts: 15

Location: Miyazaki JAPAN

  • Send private message

1

Monday, July 4th 2022, 1:09pm

I want to convert decimal points to %.

I'm in trouble! Please give me some advice.

I want to find the percent of the screen width vs. the pixel width of the image.


[div(crose-map-ratio-h,get(layer[map].pixelheight),stageheight);]

Is there a way to convert the value of crose-map-ratio-h to a percentage?


best regard:)

2

Monday, July 4th 2022, 7:22pm

Multiple by 100 and add a '%' character:

Source code

1
calc(crose-map-ratio-h, (layer[map].pixelheight / stageheight * 100) + '%');


Btw - try to avoid '-' characters in variables names!
When used in an expression, that '-' character will be parsed as minus operation.

Best regards,
Klaus

shinji

Beginner

  • "shinji" started this thread

Posts: 15

Location: Miyazaki JAPAN

  • Send private message

3

Tuesday, July 5th 2022, 11:45am

Dear Klaus
I am happy to be able to solve the problem.

>try to avoid '-' characters in variables names!

Is it okay to use'_' instead of'-'?

4

Tuesday, July 5th 2022, 12:16pm

Is it okay to use'_' instead of'-'?


yes *thumbsup*

shinji

Beginner

  • "shinji" started this thread

Posts: 15

Location: Miyazaki JAPAN

  • Send private message

5

Thursday, July 21st 2022, 11:00am

Thank you!