I'm using CDbl to validate the contents of an edit box on a dialog, and was surprised to find that it accepts strings like this:

"5.5,,,"

I found that it accepts any number of commas anywhere, so long as a digit appears somewhere.

At first I thought CDbl was blindly stripping out the thousands separator to do its checking. But I tried changing the thousands separator character (the "digit grouping symbol") in the regional control panel to another character, and it still accepted the commas. The only other comma I saw in the regional control panel was the list separator; I tried changing it too but with the same results.

Why does CDBl accept any number of commas anywhere, even if the comma is not the digit grouping symbol (thousands separator character) nor the list separator character?


Thanks,

Greg