gymun / vba-json

Automatically exported from code.google.com/p/vba-json
0 stars 0 forks source link

parseNumber and regional settings #16

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
If you set "," as the decimal point in Control panel / Regional and Language 
settings then CDbl("12.34") will throw an error, but CDbl("12,34") will be 
parsed correctly.

Some language uses comma for decimal point by default, so you can make more 
globalized parseNumber if you replace this:
  parseNumber = CDbl(value)

to this:
  parseNumber = CDbl(Replace(value, ".", Mid(CStr(0.1), 2, 1)))

Original issue reported on code.google.com by bl.lio...@gmail.com on 11 Oct 2012 at 12:13