Re: Number Entry Points
| From: | php3 at developersdesk dot com | Date: | Mon, 27 Nov 2000 11:18:55 +0000 |
| Subject: | Re: Number Entry Points | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-27325@lists.php.net to get a copy of this message | ||
Addressed to: "Real GM Webmaster" <webmaster@realgm.com>
php-general@lists.php.net
** Reply to note from "Real GM Webmaster" <webmaster@realgm.com> Mon, 27 Nov 2000
21:00:02 +1100
>
> ------=_NextPart_000_0064_01C058B5.02E71F40 Content-Type: text/plain;
> charset="Windows-1252" Content-Transfer-Encoding: quoted-printable
>
> Hi all,
>
> I have some text input boxes that require the users to put in some very =
> large numbers (into the tens of thousands). Some of our users have =
> asked if it was possible for them to enter these integers with commas as
> = seperators into the entry field (eg. 12,345,678), while some other
> users = would not (eg. 12345678). =20
>
> The problem is I have no idea how to do this and do not know where to =
> start. I have been chasing my tail for the last two days trying to find =
> a soluton without a hit of success. I can format the output so it has =
> commas as seperators, but I am unsure how to set commas as seperators on
> = the input.
$NumericVariable = str_replace( ',', '', $NumericVariable );
# Note: NumericVariable is a lie. It it has commas in it it is a string,
but that does not prevent you from using it as a number once they have been
removed.
Also look at number_format() in Numeric Functions for the way to display
your numbers with commas.
Rick Widmer
Internet Marketing Specialists
http://www.developersdesk.com