Convert string number to Decimal(currency)

Probably a simple question but I’m stuck on this…

I have a lookup which returns a GenericValue variable value of “468”.

How can I convert “468” into a string as “$468.00” ?
also, I would need to ensure that it is capable of handling thousands etc… like “1200” would be “$1,200.00” and “12000” would be “$12,000.00” etc.

Thanks!

Hi @Jon_G,

Try this:
string.Format("${0:#.00}", Convert.ToDecimal(YourVariable.ToString))

@Jon_G
give a try on the format value activity:
grafik

1 Like

Thanks so much for both these suggestions,

I managed to solve it using:
stringvariable.ToDecimal(system.globalization.cultureinfo.invariantculture).ToString("#,##0.00;-#,##0.00")

But I had no idea Format Value activity existed - in future I will try this instead! :slight_smile:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.