DISQUS

DISQUS Hello! Tech-Recipes is using DISQUS, a powerful comment system, to manage its comments. Learn more.

Community Page

Tech-Recipes

Cookbook of Tech Tutorials
Jump to original thread »
Author

AS3: How to Convert Number to String | Computer programming | Tech-Recipes

Started by qdideas · 9 months ago

No excerpt available. Jump to website »

7 comments

  • how about if I have a number, i.e.: 23 and I want to converted it to the string "0023" (with 4 digits i.e.)?...
  • same problem
    I'm getting a number from an XML, looks like 123,456,78
    i then myString.split(",").join("");
    gives me "12345678"
    now I want to use it in some math,
    i tried Number(myString);
    that just gives me the error above
  • How to do whith that?:

    var D:String;
    D = String(b * b - 4 * a * c);
  • thats cool man, but how would you know wich class to add so you can use the "string()" converter
  • or you could use (time.milliseconds).toString()
  • That doesn't work.
  • @ littleman80
    var num:Number = 23;
    var StringConverted:String = "00"+String(num);
    trace(StringConverted);

    @justin
    to convert a string to number use this
    var TheString:String = "12345678";
    var TheNumber:Number = parseInt(TheString);
    trace(TheNumber * 2) // by using * u can test that its really a number

Add New Comment

Returning? Login