Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 1st, 2006, 12:07 PM
Authorized User
 
Join Date: Nov 2006
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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.


 
Old November 6th, 2006, 02:37 AM
Registered User
 
Join Date: Nov 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Perhaps parseFloat() ?






Similar Threads
Thread Thread Starter Forum Replies Last Post
Validating string is numeric? crabjoe Classic ASP Basics 1 February 20th, 2008 10:43 AM
extract string from value of attribute camacho XSLT 1 August 16th, 2007 02:44 AM
numeric to string conversion dowens VBScript 1 May 25th, 2007 04:11 PM
changing numeric string to number not possible? Brian Campbell XSLT 1 November 16th, 2006 06:36 PM
how to extract from a string fraijo SQL Server 2000 3 October 25th, 2006 09:55 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.