p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Javascript (http://p2p.wrox.com/forumdisplay.php?f=85)
-   -   Extract first numeric string (http://p2p.wrox.com/showthread.php?t=49714)

blkskullwork November 1st, 2006 12:07 PM

Extract first numeric string
 
Hi all:
I new here and also new to javascript so I hope you'll be patient if I ask dumb questions. I have a text box with a static value of $2.99 and I want to extract just the 2.99 value and multiply it by a quantity to get a total. While I was searching for something completely different the other day I came across function(I think) which it said would extract the first numeric string in a string including decimal places if there were any. The example it gave was if you had a string of "a62.99retail" it would extract "62.99". The thing is I can't remember what the function was called or where I found it, if anyone could tell me what this function is or a similar one it would greatly appreciated.



david_kw November 6th, 2006 02:37 AM

Perhaps parseFloat() ?



All times are GMT -4. The time now is 04:38 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.