Number Formatting like 100k to 100,000

activities
studio
uipath

#1

Hi to All,

I have a project that gets likes and dislikes of Youtube videos and writes them to the excel.
and do some calculations on likes and dislikes count.

My problem is, I’m getting the likes as “100k”, so not an integer. Even if it was just “100”, I know I should convert. because Get text activity’s result is the string. However, the value is 100k, and dont know the way I should follow.

should i use “.replace()” method for K and then convert it to String?

or anything should be in excel, any other suggestions?

Cheers,

Ozi


#2

You can use VARIABLE.replace(“K”,“000”) //where VARIABLE is your string
If you need it as a number in calculations, you can add:

double.parse(VARIABlE.replace(“K”,“000”)) //where VARIABLE is your string


#3

Oh yes! im gonna add this, will inform you.
Thank you :butterfly:


#4

Hi @ozisak,

you can use this activity to format any type.

Regards
Bala