My game will only work with USA config settings. how can I set it to work with other country configs as well. It has something to do with the numbering system.
Printable View
My game will only work with USA config settings. how can I set it to work with other country configs as well. It has something to do with the numbering system.
Have a quick look at this
what kind of error are non-us users getting
?
subscript out of range. i dim 2d array 500x500 for maps, but they think 25.60 is rreally 2560
Internally VB will see 25.6 as you do... 25.6, but as soon as you start coercing strings into numbers and numbers into strings, locale steps in. Any number strings displayed to, or entered by, the end user should be in the end users locale. Likewise, any displayed number strings that need to be converted to internal numbers must be converted from the end users locale.
To show the end user a number you can use...
LocalisedNumberString = Formatnumber(1234.56)
LocalisedNumberString = CStr(1234.56)
To convert a localised number string back into a number to use internally, use the appropriate data conversion...
InternalSingle = CSng(LocalisedNumberString)
InternalLong = CLng(LocalisedNumberString)
etc...
Note, that these are less forgiving than the Val function, you have to ensure that the string to be converted is a true number.
If you want to convert numbers to strings disregarding locale, i.e. won't always make sense to the end user use...
NonLocalisedNumberString = Str$(1234.56)
and vice versa
Number = Val(NonLocalisedNumberString)
See the link above for more information.
basically a lot of countries use a comma instead of a decimal