If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Re: Trap for Young (and Old) Players - (Text Box Formatting Trap)

If you had to PRINT the result, it would need a special FORMAT, and you can easily test values that way. Printing a receipt required TWO DECIMAL PLACES extra. Can now create a MAX SIZE, and MAX VALUES to test. Hasn't failed in 14 years. Never went over $1,000 per unit, though. Can do $100K

Re: Trap for Young (and Old) Players - (Text Box Formatting Trap)

The Val function stops reading the string at the first character it cannot recognize as part of a number. Symbols and characters that are often considered parts of numeric values, such as dollar signs and commas, are not recognized.

Re: Trap for Young (and Old) Players - (Text Box Formatting Trap)

The problem you can run into when using CCur() on a Textbox is if the user enters a non-numeric value. Testing the string first can avoid this however. Formatting the contents of the Textbox afterward (as GremlinSA mentioned) can be helpful in some applications, and it can help "train" the user to enter proper values.

Code:

If IsNumeric(Text1.Text) Then
Text1.Text = Format$(Text1.Text, "##,###,##0.00")
End If

Please remember to rate the posts and threads that you find useful.How can something be both new and improved at the same time?

* The Perfect Platform for Game Developers: Android
Developing rich, high performance Android games from the ground up is a daunting task. Intel has provided Android developers with a number of tools that can be leveraged by Android game developers.

* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.