PiraxeZ
|
  |
| Joined: 06 Sep 2014 |
| Total Posts: 4254 |
|
|
| 10 Nov 2015 06:26 PM |
a = "5" b = 8 print(8+tonumber(a))
> 13
a = "5" b=8 print(a+b) >13
apparently they both print the same? is it because tonumber is set to nil? #Road to 5K posts |
|
|
| Report Abuse |
|
|
Dogejia
|
  |
| Joined: 08 Feb 2012 |
| Total Posts: 1873 |
|
|
| 10 Nov 2015 06:28 PM |
check the wiki and you'll see
Dogemon, gotta pet them all! |
|
|
| Report Abuse |
|
|
nox7
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 27467 |
|
|
| 10 Nov 2015 07:14 PM |
a+b
Calls tonumber anyways internally. Also, tonumber can transform bases.
print( tonumber("1010", 2) ) -- Binary > 10 print( tonumber("00AABB", 16) ) -- Hex > 43707 |
|
|
| Report Abuse |
|
|