
Solid, safe website tools.
Whatever your need, Will Bontrager builds powerful software solutions.
|
(Get Attention Ticker for your web site)
Stripping Invalid Characters From Currency NumbersBy Will Bontrager When building interactive calculation forms, the form user is frequently required to enter currency amounts. Currency symbols, commas, spaces, and other characters can wreak havoc with the calculation. The calculation fails, resulting in a script error, or the calculated result is incorrect. Here is a way to strip invalid characters from string values for 3 different programming languages, Perl, PHP, and JavaScript. All characters except numbers and periods are removed from the value. Perl: PHP: JavaScript: May 29, 2008 Please note: Articles on this website are presented "as is". However - If you have a question about a CGI script, HTML, CSS, PHP, or JavaScript
Rate this blog post.
No page reload! |
|
|
© 1998-2001 William and Mari Bontrager |
|