Article ID: 198098 - Last Review: May 12, 2003 - Revision: 2.0 PRB: CSng/CDbl Not Using Regional Settings for Decimal SymbolThis article was previously published under Q198098 On This PageSYMPTOMS
When you change the Regional Settings to make the Number's decimal symbol
the same as the Currency's "digit grouping symbol," CSng does not interpret
this character as a decimal point. Therefore, you get a different result
that you would have in Visual Basic 5.0. This is also the case for the CDbl
function.
CAUSE
The new oleaut32 checks to see if the character is the Currency "digit
grouping symbol" first. If it is, then even if it's also the Number's
decimal symbol, it will be considered as the Currency "digit grouping
symbol" instead of the Number's decimal symbol.
RESOLUTION
Resolve the conflicting by using the Regional Settings in the Control Panel
on the Start menu.
STATUS
This behavior is by design.
MORE INFORMATION
This new behavior is an enhancement, because the String you want to change
to a Single value may represent Currency, so it should be transformed to a
correct value. If you choose default settings for the locale, the decimal
point symbol is always different than that used as the digit grouping
symbol of Currency. So this problem only happens when one of these two
settings is manually changed, creating a conflict. Having conflicting
symbols is not valid (not just in this situation, but also in other
situations) and will probably cause other problems as well.
Steps to Reproduce Behavior
| Article Translations
|
Back to the top
