How to convert number to string Topic is solved
-
- Posts: 112
- Joined: 06 Jun 2016, 21:32
How to convert number to string
for ex
num:=123
;here this is a number format
and how do i get this in string format
To understand better,
here is the main problem
[Not working]
wb.document.GetElementbyId(Data).value:=123
[Working]
wb.document.GetElementbyId(Data).value:="123"
My problem is :
wb.document.GetElementbyId(Data).value:= "%num%"
is not working!
TIA
num:=123
;here this is a number format
and how do i get this in string format
To understand better,
here is the main problem
[Not working]
wb.document.GetElementbyId(Data).value:=123
[Working]
wb.document.GetElementbyId(Data).value:="123"
My problem is :
wb.document.GetElementbyId(Data).value:= "%num%"
is not working!
TIA
Re: How to convert number to string Topic is solved
No matter what the contents of your variable, this is incorrect syntax:
Generally, it would be:
I'm not sure why the above wouldn't work as is, but if you really need the contents to be seen as a string, try concatenating it with a null string like this:
You might also try:
Code: Select all
wb.document.GetElementbyId(Data).value := "%num%"
Generally, it would be:
Code: Select all
wb.document.GetElementbyId(Data).value := num
I'm not sure why the above wouldn't work as is, but if you really need the contents to be seen as a string, try concatenating it with a null string like this:
Code: Select all
wb.document.GetElementbyId(Data).value := "" num
You might also try:
Code: Select all
wb.document.GetElementbyId(Data).innerText := num
-
- Posts: 112
- Joined: 06 Jun 2016, 21:32
Re: How to convert number to string
okay, ill try and inform,.boiler wrote: ↑20 Jan 2022, 23:03No matter what the contents of your variable, this is incorrect syntax:Code: Select all
wb.document.GetElementbyId(Data).value := "%num%"
Generally, it would be:Code: Select all
wb.document.GetElementbyId(Data).value := num
I'm not sure why the above wouldn't work as is, but if you really need the contents to be seen as a string, try concatenating it with a null string like this:Code: Select all
wb.document.GetElementbyId(Data).value := "" num
You might also try:Code: Select all
wb.document.GetElementbyId(Data).innerText := num
-
- Posts: 112
- Joined: 06 Jun 2016, 21:32
Re: How to convert number to string
boiler wrote: ↑20 Jan 2022, 23:03No matter what the contents of your variable, this is incorrect syntax:Code: Select all
wb.document.GetElementbyId(Data).value := "%num%"
Generally, it would be:Code: Select all
wb.document.GetElementbyId(Data).value := num
I'm not sure why the above wouldn't work as is, but if you really need the contents to be seen as a string, try concatenating it with a null string like this:Code: Select all
wb.document.GetElementbyId(Data).value := "" num
You might also try:Code: Select all
wb.document.GetElementbyId(Data).innerText := num
superb, that line worked
wb.document.GetElementbyId(Data).value := "" num
Thanks friend,,
Re: How to convert number to string
One alternative: https://biga-ahk.github.io/biga.ahk/#/?id=tostring
Code: Select all
A := new biga() ; requires https://www.npmjs.com/package/biga.ahk
msgbox, % A.toString(-300)
; => "-300"