Convert String into Number

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
schwab94
Posts: 1
Joined: 03 Jan 2020, 15:34

Convert String into Number

03 Jan 2020, 18:02

Having trouble converting a string with a number, I've tried various things but always get a blank box or error message.
How would I go about storing the result of a variable multiplied by a number into a new variable?
test = "10"
test1 := %test% * 1000
Msgbox, %test1%
User avatar
boiler
Posts: 17068
Joined: 21 Dec 2014, 02:44

Re: Convert String into Number

03 Jan 2020, 18:21

Code: Select all

test := "10"
test1 := test * 1000
Msgbox, %test1%
For more info, see the documentation on expressions.
User avatar
boiler
Posts: 17068
Joined: 21 Dec 2014, 02:44

Re: Convert String into Number

03 Jan 2020, 23:59

In what way is that useful here?
BellaDyer
Posts: 1
Joined: 19 Apr 2021, 06:48

Re: Convert String into Number

19 Apr 2021, 06:50

Are there any other ways to convert? A link to a website or a tutorial will be enough for me. Thank you in advance! I am currently writing a small program related to numerology, which consists of several functions. One of these functions will determine if the entered number is lucky with the help of [Mod edit: spam link removed.]. The second function will generate a random number, which will be checked with the first function. It is a bit strange task, but it was given to me by my programming teacher, so I have no choice)
Last edited by BellaDyer on 05 May 2021, 11:03, edited 1 time in total.
Pepineros
Posts: 45
Joined: 16 Apr 2018, 17:26
Location: Ireland

Re: Convert String into Number

19 Apr 2021, 12:05

boiler is saying you don't need special tools to convert. A string "10" assigned to a variable name through expression syntax can be used as a number, as per boiler's example.
boiler wrote:
03 Jan 2020, 18:21

Code: Select all

test := "10"
test1 := test * 1000
Msgbox, %test1%
For more info, see the documentation on expressions.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: sanmaodo and 242 guests