Convert any variable to Generic Value

Hi everybody!

I need to use Format Value activity but in order to do that, I need to convert my initial variable of type double to Generic Value since Format Value only accepts this kind of input argument. Is there any fast way to do it except for creating temporary generic value variable that will store this initial double variable?

In general - is there a way to convert any kind of variable to generic value? Something like CInt or ToString etc.

Thanks!

can you show us with example what you want to achieve with Format value activity…
we would like have sample input and out

@Marta
maybe this could help:
grafik

Hello @Marta,

Please find below URL that could help,
https://docs.microsoft.com/en-us/dotnet/visual-basic/programming-guide/language-features/data-types/generic-types

OR

you could also use a invoke code activity.

Thanks,
Pankaj

For example:

I have value 2 (it is of type double) and I want it to be 2.0

or

I have 2000 and i want it to be 2,000.0

What do you mean by use invoke code activity? How exactly?

@Marta
you can do it directly on the double value:
grafik

ensure:
grafik

I guess below statemets would do your job,

Dim vIn As Double = 0.0.
Dim vOut As Decimal = Convert.ToDecimal(vIn)

try below:
Strings.FormatNumber(strVal) you can pass decimal variable as well
Strings.FormatNumber("20000") >>> 20,000.00

but please note that this is going to give you 2 decimal place[20,000.00 instead of 20,000.0]