I am looking for number format as per following 1200,00,000.00

studio

#1

Hi Team,

I have following value 120000000.00 and I want this value suppose to show as per following number format.

Input value : 120000000.00
Expected number format : 1200,00,000.00

Kindly assist me.


#2

Hi @kawalkarhemant,

Try this one

int number = 1234567890
Convert.ToDecimal(number).ToString("#,##0.00")
You will get the result 1,234,567,890.00

Regards,
Arivu


#3

My expected format is - 1200,00,000.00


#4

It has been answered to you already here, If I am not wrong :slight_smile:


#5

Hi @kawalkarhemant,
Here I have attached the file to fix your situation.

File : NumberFormat.zip (2.3 KB)

Note :
You can define your custom format. I have used the “en-US”. But if you want , you can change your own culture and specify the separators for grouping and decimal.

Regards
Balamurugan


#6

This time format is different buddy. :slight_smile:


#7

out_value=in_Value.ToString(“N2”, nfi)

Hey buddy appreciate your answer.
However, can you please explain here what is “N2” in above code?


#8

Hi @kawalkarhemant,

The “N2” is, after the decimal digits. you can use “N3”, The result should be like this “1200,00,000.000”

Regards
Balamurugan


#9

@kawalkarhemant I went through the link provided by Dominic.Your format is same as the solution provided in link


#10

Hi,

I got the expected output. I just want to know what is “N2” in your vb.net code?


#11

Hi @kawalkarhemant,

N2 means after dot two digits will allow.

Refer this link

https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings

"N" or “n” Number
For example

1234 ->"N" -> 1 234
1234 ->"N1" -> 1 234.0
1234.56 ->"N2" -> 1,234.56
1234.56 ->"N3" -> 1,234.560

Regards,
Arivu


#12

Hi @kawalkarhemant and all members,

I have created a custom activity to format the double and number values instead of using the code invoke. Using this activity you can able to format in any combination. It has 2 activities. One is for double value and another one is for integer. I Hope it will helpful .

Below I have attached
1.Nuget Package - Format.DoubleInteger.Activities.1.0.0.nupkg (6.1 KB)
2.Setup document -Uipath Nuget Setup Document.zip (68.6 KB)
3.Samples - NumberFormatNuget.zip (2.2 KB)

Suggestions and name changes are welcome.

Thank you
Balamurugan.S


Number format issue