Check the type

I need to check that if the variable type is int, then i need to change the format to “{0:0.0}”, how we can do this via query or function.

Can you please explain more about your use case? It would be better if you could share some sample data also.

Thanks

@agathiyanv ,
You can ue String.Isnumeric to check if it is int or not!

Hi @agathiyanv

You can get the Variable type Like this

YourVariable.GetType

Uss If condition and check it

Regards
Gokul

HI @agathiyanv

Try like this

if(Input.GetType.Tostring.Equals("System.Int32"),Cdec(Input.ToString).ToString("#.00"),"Not An integer")


Hope this Helps

Regards
Sudharsan

can we remove the else part?

Yes if you don’t need anything you simply give a empty quotes there like “” @agathiyanv

1 Like

Hi @agathiyanv

Check out this docs

https://www.edureka.co/blog/variables-data-types-activities-in-uipath#:~:text=In%20UiPath%2C%20it%20could%20either,then%20choose%20the%20Variable%20Type.

Regards
gokul