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

后端 未结 9 925
無奈伤痛
無奈伤痛 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:16

    Have you tried:

    currentBalance.ToString("#,##0.00");
    

    This is the long-hand equivalent of:

    currentBalance.ToString("N2");
    

提交回复
热议问题