amaro tati
amaro tati

Reputation: 55

How to change the decimal format

I want to change the decimal place separator I changed the location, but it still does not change

Current result 100,200.00 expected result 100.200,00

item.currentAmount.ToString(string.Format(new CultureInfo("pt-BR"), "{0:N2}"));

Upvotes: 1

Views: 84

Answers (1)

D-Shih
D-Shih

Reputation: 46229

You can try to use string.Format override method

Format(IFormatProvider, String, Object)

Setting the culture on the first parameter.

string.Format(new System.Globalization.CultureInfo("pt-BR"),"{0:N2}",item.currentAmount)

c# online

Upvotes: 3

Related Questions