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%
Convert String into Number
Re: Convert String into Number
Code: Select all
test := "10"
test1 := test * 1000
Msgbox, %test1%
Re: Convert String into Number
https://biga-ahk.github.io/biga.ahk/#/?id=parseint may be of use here.
Code: Select all
A := new biga()
msgbox, % A.parseInt("10") * 1000
; => 10000
Re: Convert String into Number
In what way is that useful here?
Re: Convert String into Number
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.
Re: Convert String into Number
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:21For more info, see the documentation on expressions.Code: Select all
test := "10" test1 := test * 1000 Msgbox, %test1%
Who is online
Users browsing this forum: sanmaodo and 242 guests