No prob...Happy to help, for those who missed it, The solution includes a killer money formatting algorithm...beh old the power of regular expressions...
StripNumber removes all characters except for numbers, periods (for decimal point), and hyphens (for negative sign). This could be made more specific by removing any hyphens not on the front of the number or only allowing the first period, but this was good enough for what I was doing....
User Profile
Collapse
-
Last edited by acoder; Feb 12 '08, 07:52 AM. -
DOH!!!!!!!
Never try to code after 48 hours without sleep.....Thank s...You are of course correct, and everything works just beautiful when you do that...
Problem solved....
In the interest of giving back to the community, here is the finished code...
[CODE=javascript]{
var arDone = new Array;
function stripNumber(num ) {
return num.toString(). replace(/[^\d\.-]/g,...Leave a comment:
-
Object Access By Reference?
OK...I have a function that formats some form input data. When I run the function I save the form object in an array...So far so good.
Now when I am done with my page I want to go back and remove the formatting from the objects. Should be easy since I saved those objects previously, but it appears that what I have is a copy of those objects and not a reference to those objects. So anything I try to update at the end does nothing...
No activity results to display
Show More
Leave a comment: