Casting to a Number : Number : Data Type Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Data Type » Number »

 

Casting to a Number


 

package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){
        var nOne:Number = Number("468");    // 468
        var nTwo:Number = Number("23.45");  // 23.45
        var nThree:Number = Number("abc");    // NaN (Not a Number)
        var nFour:Number = Number("0101");   // 65 (Octal)
    }
  }
}

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


Flash / Flex / ActionScript examples

 Navioo Data Type
» Number