Adding decimal to the Integer

I need to change the display format
for eg:
123456 - 1,23,456.00
123456.78-1,23,456.78
and the number of digits after decimal place is dynamic.
How to solve this?

HI @agathiyanv

Check out this expression

CDbl(YourString).ToString("N", CultureInfo.InvariantCulture)

Output @agathiyanv

image

Regards
Gokul

Hi,

If your input is Double type, the following will work

doubleVar.ToString("N2")

If your input is String type, the following helps you.

Double.Parse(stringVar).ToString("N2")

image

if you need to change number of igits after decimal point, please change N2 to N3 for example.

Regards,

Hi,

I need in this type 1,23,456.00

Do you mean ","is not thousand separator? If so, can you share rule where “,” character should be added?

Regards,

That was my mistake.
Can we add decimal at the end of integer
like 1000 - 1000.00 without comma separator

Hi,

Can you try "#.00" instead of "N2" as the following?

image

Regards,

1 Like

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