or parseFloat() for floating point numbers.
Scott
-Original Message-
From: [EMAIL PROTECTED] on behalf of Thomas Fowler
Sent: Mon 5/8/2006 8:24 PM
To: Flashcoders mailing list
Cc:
Subject:Re: [Flashcoders] Casting a string to a number ...
parseInt is the preferred
parseInt is the preferred way to get a number from a string.
On 5/8/06, Ramon Miguel M. Tayag <[EMAIL PROTECTED]> wrote:
You can use parseInt
number = parseInt(string);
--
Ramon Miguel M. Tayag
Managing Director
Quirkworks
___
Flashcoders@chattyfig.
You can use parseInt
number = parseInt(string);
--
Ramon Miguel M. Tayag
Managing Director
Quirkworks
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashco
A couple of times I have tried to cast a string to a number like so (this is
just an example):
var string:String = "9";trace(string);var number:Number =
Number(string);trace(number);trace(typeof(number));
It seems to work, but is this the correct way to cast.
Thanks,
Stephen.___
4 matches
Mail list logo