Currency formatting

后端 未结 3 1738
囚心锁ツ
囚心锁ツ 2020-12-02 17:12

This should be an easy problem but...

I need to format a currency for display (string) in C#

The currency in question will have its own rules such as the sym

3条回答
  •  有刺的猬
    2020-12-02 18:10

    To work with a textbox, try the following:

    textBox2.Text = "Rp" + (textBox1.Text = string.Format(System.Globalization.CultureInfo.GetCultureInfo("id-ID"), "{0:#,##0.00}", double.Parse(textBox1.Text)));
    

提交回复
热议问题