Replace Number to required format?

I need to replace number like this Input is 1.123,99 the . should be replaced by , and , should be replaced by . and output should be 1,123.99. How can we do this?

Hi @pavankalyan

How about using Split method?

Regards

@pavankalyan

Hope the below will provide the solution,


Replace 2

Thank you.

Double.Parse("1.123,99",System.Globalization.CultureInfo.CreateSpecificCulture("de-DE"))
 1123.99
 Double.Parse("1.123,99",System.Globalization.CultureInfo.CreateSpecificCulture("de-DE")).toString("F2")
 "1123.99"
 Double.Parse("1.123,99",System.Globalization.CultureInfo.CreateSpecificCulture("de-DE")).toString("N2")
 "1,123.99"

Thanks for quick help @pravin_calvin @ppr @Jobin_Joy

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