Format a double value like currency but without the currency sign (C#)

后端 未结 9 914
無奈伤痛
無奈伤痛 2020-12-25 10:07

I feed a textbox a string value showing me a balance that need to be formatted like this:

###,###,###,##0.00

I could use the value.ToString

9条回答
  •  眼角桃花
    2020-12-25 10:19

    var result = currentBalance.ToString("C").Replace(System.Globalization.CultureInfo.CurrentCulture.NumberFormat.CurrencySymbol, "");
    

提交回复
热议问题