Convert string to number Topic is solved

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
madsounds
Posts: 59
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 “Ask for Help (v2)”

Who is online

Users browsing this forum: CraigM, Johncoool, mikeyww, zabbn and 40 guests