formating captured text (string 2 number)

finally i've managed to read a text from a screen but now i have to format it.
so far i got:
put ReadText(("windowWithValue"), validcharacters:",.1234567890", trim: yes, IgnoreSpaces: ON) into variableName
what i get looks like: 45 345,00 (i assume it's a plain string, right?)
what i need is an floating point number: 45345.00
how can i convert from a string to a float/double type number my variable?

Comments

  • EggplantMattEggplantMatt ForumAdmin admin
    Can you post a screenshot of what you are trying to read? You might be able to get a better result back from the readtext if you modified the parameters some more. You could convert the string you're getting back into the number your looking for like this:
    replace space with empty in variablename
    replace comma with period in variablename
    
    However, since you list comma as a valid character, it's not going to be a good general practice to replace comma with period -- you could end up converting "123,456.78" to "123.456.78". But until you make those changes, you wouldn't be able to use the value as a number.
Sign In or Register to comment.