Convert string to number Topic is solved

Get help for the alpha version of AutoHotkey v2 here. Please state the v2 version you are working with in the title when making a new topic.
madsounds
Posts: 53
Joined: 31 May 2019, 08:14

Convert string to number

26 Nov 2020, 00:17

Is + 0 the only method in AHK to convert string into number?

Code: Select all

str_int := "100"
str_float := "100.0"
MsgBox Type( str_int ) ;String
MsgBox Type( str_float );String

num_int := str_int + 0
num_float_a := str_int + 0.0
num_float_b := str_float + 0
MsgBox Type( num_int ) ;Integer
MsgBox Type( num_float_a ) ;Float
MsgBox Type( num_float_b ) ;Float

MsgBox Type( "100" + 0 ) ;Why this considered error, by the way?

Return to “AutoHotkey v2 Help”

Who is online

Users browsing this forum: TheArkive and 3 guests