I have to retrieve a number from a string.
I have to retrieve another number from another string.
In my country the decimal sign is , and not .
I have to subtract second number by first number
my code does not work
here is my code
Code: Select all
SetFormat, float, 0.2
ControlGetText, testo, Edit2, Gestione Foglio
pos:= InStr(testo, "INTERESSI EURO")
intMutuo:=SubStr(testo,pos+15)
ControlGetText, addeb, Edit1, Scomponi riga
addebito:=ToNum(addeb)
interessi:=ToNum(intMutuo)
addNetto:= addebito - interessi
MsgBox, %addNetto% <--------------This shows me a blank space instead of the result expected
return
ToNum(stringa)
{
StringReplace, ToNum, stringa,%A_Space%,,All
StringReplace, ToNum, ToNum, ., , All
StringReplace, ToNum, ToNum, `,,., All
MsgBox, % ToNum <---------------this shows me correctly the number in format 1234.56
}