Re: GTK and doubleval
| From: | Steph | Date: | Thu, 11 Sep 2003 11:09:33 +0000 |
| Subject: | Re: GTK and doubleval | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-3863@lists.php.net to get a copy of this message | ||
I'm not able to reproduce this on my box. Which version of PHP are you
using, and which platform?
----- Original Message -----
From: "SIMONE COSCI" <simone@interworld.it>
To: <php-gtk-general@lists.php.net>
Sent: Thursday, September 11, 2003 10:04 AM
Subject: [PHP-GTK] GTK and doubleval
Hello,
I' ve found a problem about Variables Types using GTK...
Try this code using GTK and without them, I' ve different result ...
I have 2 strings (from DB) $a and $b that represent double values ... if
I call gettype($a) return String ...
I have to cast the Strings in Doubles and add $a to $b obtaining $t ...
Without GTK the result is correct ... 53.99 ...
if I Uncomment the dl() (loading GTK classes) the result become 53 (gtk
trim decimals ?)
Try with doubleval() ... same result ...
/*
if (!class_exists('gtk')) {
if (strtoupper(substr(PHP_OS, 0,3) == 'WIN')){
dl('php_gtk.dll') or Die("dll not found");
define("BAR","\\");
define("LFCR","\r\n");
}else{
dl('php_gtk.so') or Die("so not found");
define("BAR","/");
define("LFCR","\n");
}
}
*/
$a = "41.490";
$b = "12.50";
$a = floatval($a);
$b = floatval($b);
$t = $a + $b;
echo floatval($t);
//gtk::main();
Someone can help ?
Tnx
Simone