generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: What is the point of tonumber? when you can just

Previous Thread :: Next Thread 
PiraxeZ is not online. 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 is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image