|
-
Sep 7th, 2007, 05:05 PM
#1
Thread Starter
Fanatic Member
Making my game universal
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.
-
Sep 7th, 2007, 06:11 PM
#2
Re: Making my game universal
Have a quick look at this
-
Sep 7th, 2007, 11:00 PM
#3
Re: Making my game universal
what kind of error are non-us users getting
?
-
Sep 8th, 2007, 10:02 PM
#4
Thread Starter
Fanatic Member
Re: Making my game universal
subscript out of range. i dim 2d array 500x500 for maps, but they think 25.60 is rreally 2560
-
Sep 9th, 2007, 04:15 AM
#5
Re: Making my game universal
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.
Last edited by Milk; Sep 9th, 2007 at 07:29 PM.
Reason: more stuff to add...
-
Sep 9th, 2007, 07:54 AM
#6
Re: Making my game universal
basically a lot of countries use a comma instead of a decimal
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|