Format Value

i want to convert decimal number 0.18 into percentage 18% but by using format value it gives me 18 % in set format decimal digit i don’t want to enter any value. Can anyone help me in this?

Thankyou!

Hi @praveen5

Welcome to UiPath community

Can try with this expression in the Assign activity

PercentageValue = (YourDecimalValue * 100).ToString("F0") & "%"

image

Regafrds
Gokul

Hi @praveen5

decimalValue= 0.18
formattedPercentage= String.Format("{0:P}", decimalValue)

{0:P} is a format specifier that represents a percentage with the default number of decimal places. It will automatically format the decimal number as a percentage without specifying the exact number of decimal places.

Hope it helps!!

As i’m reading value from excel like (e.g 18%) but the UiPath studio reads it as 0.18 so i’m converting it using Format value activity but it gives me 18 % i don’t wanna space between them.

Hi @praveen5

Use Format cells activity.

image
image

Hope it helps!!

(yourNumberVar * 100).ToString(F0) + “%”

Hi @praveen5 ,

Could you enable the PreserveFormat Property on the Read Range activity and check whether it is able to extract as Required ? If there are no computations performed on the value then it should be ideal for your case.

Thanks !
It’s working now :+1:

1 Like

Hi @praveen5

Check with the below expression

DecimalValue = 0.18
PercentageString = (DecimalValue * 100).ToString("0.00")

Hope it helps!!