Select to view content in your preferred language

Converting VBScript to Arcade

628
5
Jump to solution
06-26-2023 11:20 AM
SamanthaJordan
New Contributor III

I posted in ArcGIS Pro but I think I saw a few post similar questions on here. So I apologize if this isnt the correct place.

I need help converting VBScript into Arcade. This is the VBscript: Round (UTC_Pct, 0) & "%"

Anyone know how I can convert that into Arcade?

SJ

 

0 Kudos
1 Solution

Accepted Solutions
gpopulis
New Contributor II

As stated above Round is pretty straight forward, just have to access the attribute from the features with something like: Round($feature.UTC_Pct,0). To get the "%" at the end use the Concatenate function.

ex. Concatenate(Round($feature.UTC_Pct,0),"%")

Systems Analyst II
City of Ventura

View solution in original post

5 Replies
GregKeith
Occasional Contributor III

Not sure what your ':' section means (maybe format into code style), but Round is pretty simple: https://developers.arcgis.com/arcade/function-reference/math_functions/#round

SamanthaJordan
New Contributor III

Thank you!

0 Kudos
gpopulis
New Contributor II

As stated above Round is pretty straight forward, just have to access the attribute from the features with something like: Round($feature.UTC_Pct,0). To get the "%" at the end use the Concatenate function.

ex. Concatenate(Round($feature.UTC_Pct,0),"%")

Systems Analyst II
City of Ventura
SamanthaJordan
New Contributor III

Thank you! I'll give that a shot.

0 Kudos
KenBuja
MVP Esteemed Contributor

Since the default value for Round's number of places is 0, you don't need to add that to your expression.

You can also use template literals in your expression to easily add extra text.

`${Round($feature.UTC_Pct)}%`