String.ToInteger

If you put the following in the open event of a mobile screen, why does score = 10 instead of 10,000?

var score as integer
var s as string = "10000"
var x as double = s.ToDouble

s = x.ToString("###,###")
score = s.ToInteger

self.Title = "Score " + s.ToText

The comma in S.

Look at the notes section of this page for an explanation:

Ok, if I swap these lines around score retains the value of 10000. I didn’t realise the , or . in the string kill the val for the rest of the string.
‘s’ is actually being read from file as a string is there a way to directly format it with commas for place value or am I correct converting it to a double first?

Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.