Navigation

    Fuze Arena Logo
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Help
    • Discord

    Is it possible to convert a string of text into an integer/number?

    Beginners
    2
    5
    292
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Zypher
      Zypher last edited by

      For example test= "5"
      Can the string "5" be converted into just 5? So that test will only hold 5 instead of "5"

      1 Reply Last reply Reply Quote 1
      • M
        MikeDX last edited by

        yes!

        var = int("12")
        
        
        1 Reply Last reply Reply Quote 3
        • Zypher
          Zypher last edited by

          Oh wow that's easy. Thanks!

          1 Reply Last reply Reply Quote 0
          • Zypher
            Zypher last edited by

            @MikeDX as a follow up, does string() convert an integer into a string? And what is the propped syntax because it's telling me that function does not exist

            1 Reply Last reply Reply Quote 1
            • M
              MikeDX last edited by

              Good guess!

              The function you want is str

              myvar = str(1)
              
              1 Reply Last reply Reply Quote 3
              • First post
                Last post