在TEXTBOX 上顯示金額
'將金額格式化
Dim Amount as integer = 88971
TextBox1.Text = FormatCurrency(Amount, 0, TriState.True, TriState.False, TriState.True)
結果顯示 NT$88,971
'將金額格式化且不顯示貨幣符號
Dim Amount as integer = 88971
TextBox1.Text = FormatCurrency(Amount, 0, TriState.True, TriState.False, TriState.True).Replace("NT$", "")
結果顯示 88,971
參考連結:
Strings.FormatCurrency(Object, Int32, TriState, TriState, TriState) Method