How to add comma to the integer value

Hi,

I am trying to convert a amount with a format. For Example : I have a amount as 1900.00
the output i am expecting is 1,900.00. I tried using Format activity but i am not getting the expected output.
If the Amount is 1000000 then the output should be 10,00,000 but using the Format activity the output that i am getting is 1,000,000.
How do i convert it to the expected format?

Kindly help me resolve this issue

Thank you

Hi @sneha_arbole1,
can you try out this below expression

yourIntergerVariable.ToString(β€œ#,##0.00”)

It will format the desired output as per your expectation

Regards,
Robin

Hi @sneha_arbole1

Give a try to this


Sample Workflow
Format.xaml (5.3 KB)

Hi @sneha_arbole1

Check this below code,
formattedValue(variable as String data type) = CDbl("10000000").ToString("#,#.00", System.Globalization.CultureInfo.CreateSpecificCulture("hi-IN"))

Hope this may help you :slight_smile:

3 Likes

Hi @sneha_arbole1 ,

Could you let us know if the activity mentioned by you was Format Cells Activity ? If so, was it configured in the below way. I am able to get the output in the required way using the below configuration.
image

Let us know if you have tried the above method.

I have used Format Value activity

@sneha_arbole1 ,

Is it possible for you to use Format Cells Activity ? This would need for you to have the latest version in place having the Modern Design Experience enabled.

Hi @supermanPunch

Thank you for the Advice. I was able to get the expected output by using the following syntax
CDbl(β€œ10000000”).ToString(β€œ#,#.00”, System.Globalization.CultureInfo.CreateSpecificCulture(β€œhi-IN”))

1 Like

HI @sneha_arbole1

Using the Format Value activity from the UiPath.Core.Activities package.

This activity allows you to associate a specific format to a generic value that can be used with .ToString and Parse operations.

You can use this activity to format your integer value as a currency or a number with thousands separator

Regards
Gokul

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