RE: [PHP] What to use?
| From: | Robert Cummings | Date: | Thu, 25 Sep 2003 20:35:44 +0000 |
| Subject: | RE: [PHP] What to use? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-163997@lists.php.net to get a copy of this message | ||
On Thu, 2003-09-25 at 16:28, Jeff McKeon wrote:
> Correct me if I'm wrong please, but I think number_format() has the
> adverse effect of changing the value type from numeric to char and
> therefore baring you from using it in mathematical equation later in the
> script.
>
> Anyway that's what it seemed to do to me when I used it on results from
> a MySQL query...
That shouldn't happen. PHP is a typeless language and so type
conversions are juggled on the fly. If you pass a numerical string to a
mathematical operator, then the string will be converted to the
appropriate value.
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com
|
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'