Reputation: 319
I have textbox and I need to convert format of that to curency and money format with comma seprator ( like 12,654,500
) can anybody help me ??
private void txtMuchMoney_TextChanged(object sender, EventArgs e)
{
}
Upvotes: 0
Views: 532
Reputation: 6251
Use this mask:
$000,000,000
Refer to this MSDN article for more information on masks.
$
: Currency symbol. The actual character displayed will be the currency symbol appropriate to the format provider, as determined by the control's FormatProvider property.
,
: Thousands placeholder. The actual display character used will be the thousands placeholder appropriate to the format provider, as determined by the control's FormatProvider property.
So, you might also want to set the FormatProvider property if you not get the desired behavior out-of-the-box.
Upvotes: 1
Reputation: 3009
How about using a MaskedTextBox instead
https://msdn.microsoft.com/en-us/library/system.windows.forms.maskedtextbox.mask(v=vs.110).aspx
the mask property value should simply be 00,0000,000
Upvotes: 0