Article ID: 171488
Article Last Modified on 11/18/2003
170365 INFO: Visual Studio 97 Service Packs - What, Where, and Why
171554 INFO: Visual Basic 5.0 Fixes in Visual Studio 97 Service Pack 2
The Val function recognizes only the period (.) as a valid decimal separator. When different decimal separators can be used, for example, in international applications, use CDbl instead to convert a string to a number.
Returns...
----------
Val("1.2") 1.2
Val("1,2") 1
However, with Microsoft Visual Basic version 5.0, when the system Decimal
separator is a symbol other than a period (.), the Val function will
recognize the system Decimal separator instead of the period (.) as
documented. The following table illustrates the results of the Val function
when the Decimal separator is set to a comma (,):
Returns... But Should Return...
---------- --------------------
Val("1.2") 1 1,2
Val("1,2") 1,2 1
Debug.Print Val("1.2")
Debug.Print Val("1,2")
1
1,2
1,2
1
Additional query words: intl
Keywords: kbbug kbfix kbvbp500sp2fix kbvs97sp2fix KB171488