[EMAIL PROTECTED] wrote:
I am just curious because I am trying to do this in Flex
Handy little trick: subtract 0.
var val = "100";
trace(typeof val); // string
val = val - 0;
trace (typeof val); // number
Theres also parseInt, parseFloat, and the Number conversion.
-d
:57
AM
Subject: [flexcoders] How do you convert
a string to a number
I am just curious because I am trying to do this in Flex
Here’s a way to do it using actionscript;
var i:Number=10;
var s:String;
s=String(i);
trace(s); // 10
trace(typeof s); // string
Alex Hearnz
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 09, 2005
9:58 AM
To: [EMAIL PR
L PROTECTED]
Sent: woensdag 9 maart 2005 15:58To:
flexcoders@yahoogroups.comSubject: [flexcoders] How do you convert a
string to a number
I am just curious because I am trying to do this in Flex
4 matches
Mail list logo