Results 1 to 7 of 7

Thread: String to Numeric

  1. #1

    Thread Starter
    Member Evolute's Avatar
    Join Date
    Sep 2002
    Location
    Portugal
    Posts
    58

    String to Numeric

    Hi all

    How can i convert a string from a textbox to a numeric value?

    Thanks!
    Evolute

  2. #2
    Frenzied Member DeadEyes's Avatar
    Join Date
    Jul 2002
    Posts
    1,196
    Are you talking about JavaScript?
    In which case you have to remember JS doesn't really have proper datatypes.
    Whatever you first initialise a var it will take the type of whatever it is you used to initialise it with.
    There are however two functions
    Code:
     num = parseInt(textbox.value);
     num = parseFloat(textbox.value);

  3. #3

    Thread Starter
    Member Evolute's Avatar
    Join Date
    Sep 2002
    Location
    Portugal
    Posts
    58
    thanks a lot .. it helped me enough!
    Evolute

  4. #4

    Thread Starter
    Member Evolute's Avatar
    Join Date
    Sep 2002
    Location
    Portugal
    Posts
    58
    Hi again.. and now.. how can i convert a numeric to a string ?


    Thanks!
    Evolute

  5. #5
    Frenzied Member DeadEyes's Avatar
    Join Date
    Jul 2002
    Posts
    1,196
    See your "length of value" thread

  6. #6

    Thread Starter
    Member Evolute's Avatar
    Join Date
    Sep 2002
    Location
    Portugal
    Posts
    58
    Yes.. I already saw it! Thanks.. I have another question for you.. see the other thread again.
    Evolute

  7. #7
    Frenzied Member DeadEyes's Avatar
    Join Date
    Jul 2002
    Posts
    1,196
    What's the question?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width