How to remove the rupees or dollars symbols or any special symbols before the amount and also how to add the common based on amount using Uipath

Hi Team,

I have some amount in a Excel but I have to check if amount have any dollar symbols or not .
If any symbols are available need to remove the symbols and also need to check if amount contains common or not .

For example amounts are 1500 or 15000.22 or 155000.12 like this
Based on amount I need to add comma
Output will be 1,500.00 , 15,000.22 and 1,55,000.12 like this

One more example like ₹1200.09 and €3294.54 , ₹223450 like this
Need to remove any symbols before the amount and output will be 1,200.09 and 3,294.54 and 2,23,450.00 like this .

Kindly suggest

hello @Baby123
you can try to use this to remove any kind of non characters present in string
System.Text.RegularExpressions.Regex.Replace(text, “\W”,“”)

and to add comas you can use this.
formattedValue(variable as String data type) = CDbl(“your value”).ToString(“#,#.00”, System.Globalization.CultureInfo.CreateSpecificCulture(“hi-IN”))

Ich würde dies direkt im Excel über das Zellenformat machen.

@Baby123,

Use regex pattern for this.

image

In Studio, use like this.

image

Output:
image

Thanks,
Ashok :slight_smile:

Hi @ashokkarale,

Thank you for your quick response.

Sometimes Input data like this also.

€994017 or €994017.00 or €9,94,017.00 or 9,94,017 or 994017 or 9,99,017.00

I am expecting output will be like this .
9,99,017.00

Kindly suggest

@Baby123,

Use this.

[^\d]*([\d,]+(?:\.\d+)?)

image

Thanks,
Ashok :slight_smile:

Hello @ashokkarale ,

It’s working in regex website but when try to execute in UiPath studio i am not getting exact value .
Attached is the screenshot for your reference kindly suggest.

Let me explain my task clearly again.

Input is 9999 output is 9,999.00
Input 99999.00 - output is 9,99,99.00
If any symbols like dollar or rupees is available before the input amount like
₹999 output - 999.00
₹9999 output - 9,999.00
₹99999 output - 9,99,999.00

Sometimes I am getting correct format like 999.00 or 9,999.00 or 9,99,999.00 like this
No need to change the input values .

If not I need to change using UiPath

Kindly suggest

If possible please send me .xmal file

@Baby123,

Sorry! I overlooked the problem statement. Here is the solution you are seeking.

Input:

Output:
image

Solution workflow:

ReGexDemo.xaml (8.5 KB)

Thanks,
Ashok :slight_smile:

Hi @ashokkarale ,

I was tired above ,xaml file but I forgot to update you like
I need those amount will be US standard not in Indian Standard.

Can you please let me know solution.

Input: 1234567890
Output : 1,234,567,890.00

Kindly suggest.

Thanks.

@Baby123,

Change the CultureInfo to this and you should have the desired output.

CDbl(strOutput).ToString("#,#.00", System.Globalization.CultureInfo.CreateSpecificCulture("en-US"))

Input:

Output:
image

Thanks,
Ashok :slight_smile:

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