if you want a number displayed in currency format use FormatCurrency()
so you can have a person enter a number into the textbox then in the lostfocus event you can format it for currency:
VB.NET:
Private Sub Textbox1_LostFocus (...) Handles Textbox1.LostFocus
Textbox1.Text = FormatCurrency(Textbox1.Text)
End Sub
as far as checking a string to see if it's in currency format you can use Mid() so see if the first character is a "$" and there's at least 1 period with no letters (only numbers)
also the IsNumeric() function is your friend for checking to see if something is a number or not as well
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.