Jump to content




How to change string to number (int) ?


  • You cannot reply to this topic
3 replies to this topic

#1 mibac138

  • Members
  • 132 posts
  • LocationPoland

Posted 26 May 2013 - 02:09 PM

As I say in topic, my question is: How to change string to number?


Please help!



#2 Xenthera

  • Members
  • 170 posts

Posted 26 May 2013 - 02:20 PM

tonumber(string)

#3 mibac138

  • Members
  • 132 posts
  • LocationPoland

Posted 26 May 2013 - 02:24 PM

ohhhh, thanks forgot about this :/

#4 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 26 May 2013 - 10:16 PM

also it should be noted that the `tonumber` function can also accept a radix.
tonumber( [string], [radix] )
So something like
tonumber("f", 16)
would convert the hexadecimal `f` (base-16) into decimal `15` (base-10)





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users