Re: R: [PHP-GTK] GTK and doubleval (RESOLVED)
| From: | SIMONE COSCI | Date: | Thu, 11 Sep 2003 10:42:19 +0000 |
| Subject: | Re: R: [PHP-GTK] GTK and doubleval (RESOLVED) | ||
| References: | 1 2 3 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-3867@lists.php.net to get a copy of this message | ||
These great italians ...
Using GTK .... doublevals are comma separated, without GTK doublevals are
dot separated ...
IT RUNS WITH APICES ...
if (!class_exists('gtk')) {
if (strtoupper(substr(PHP_OS, 0,3) == 'WIN')){
dl('php_gtk.dll') or Die("non trovo la dll");
define("BAR","\\");
define("LFCR","\r\n");
}else{
dl('php_gtk.so') or Die("non trovo lo shared object");
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();
GRAZIE A TUTTI QUELLI CHE MI HANNO DETTO TOGLI GLI APICI ...
----- Original Message -----
From: "SIMONE COSCI" <simone@interworld.it>
To: "Steph" <steph.fox@virgin.net>; "Dimitri Giardina"
<dimitri@cdinformatica.it>; "Php-Gtk-General"
<php-gtk-general@lists.php.net>
Sent: Thursday, September 11, 2003 12:23 PM
Subject: Re: [PHP-GTK] R: [PHP-GTK] GTK and doubleval
> I' m using a Win2K php4.4 and gtk 0.5.2
> That vaiables arrives from a remote db ... and arrives as STRINGS .... I
> can't write them without "" ..-..
> I try To CAST (change of primitive type) and the casting trim the decimals
> ... FUCK
>
> ----- Original Message -----
> From: "Steph" <steph@php.net>
> To: "Dimitri Giardina" <dimitri@cdinformatica.it>; "Php-Gtk-General"
> <php-gtk-general@lists.php.net>
> Sent: Thursday, September 11, 2003 1:10 PM
> Subject: Re: [PHP-GTK] R: [PHP-GTK] GTK and doubleval
>
>
> > Ah, it's Edin's old snap!
> >
> > (PHP issue, resolved).
> >
> > ----- Original Message -----
> > From: "Dimitri Giardina" <dimitri@cdinformatica.it>
> > To: "Php-Gtk-General" <php-gtk-general@lists.php.net>
> > Sent: Thursday, September 11, 2003 10:03 AM
> > Subject: [PHP-GTK] R: [PHP-GTK] GTK and doubleval
> >
> >
> > > -----BEGIN PGP SIGNED MESSAGE-----
> > > Hash: SHA1
> > >
> > > these stranges italians ;)
> > >
> > > (under win32).
> > >
> > > $a = 41.490; (without apices)
> > > $b = 12.50;
> > >
> > > C:\tmp>php provafx.php (with apices, without gtk)
> > > 53.99
> > > C:\tmp>php provafx.php (with apices, with gtk)
> > > 53
> > > C:\tmp>php provafx.php (without apices, without gtk)
> > > 53.99
> > > C:\tmp>php provafx.php (without apices, with gtk)
> > > 53,99
> > >
> > > wow...
> > > i think it's a problem in localizing/printing float numbers.
> > >
> > >
> > >
> > > Dimitri Giardina
> > >
> > > > -----Messaggio originale-----
> > > > Da: SIMONE COSCI [mailto:simone@interworld.it]
> > > > Inviato: giovedì 11 settembre 2003 12.05
> > > > A: php-gtk-general@lists.php.net
> > > > Oggetto: [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
> > > -----BEGIN PGP SIGNATURE-----
> > > Version: GnuPG v1.0.6 (MingW32)
> > > Comment: For info see http://www.gnupg.org
> > >
> > > iEYEARECAAYFAj9gSFcACgkQjbCncHBsBCKxKwCfTIsqi3OGq+yYWYLouQp0r0iT
> > > E2UAoLgR2FzODC4H+ujS/r1rSpZWBNMO
> > > =Cd55
> > > -----END PGP SIGNATURE-----
> > >
> > >
> > > --
> > > PHP-GTK General Mailing List (http://gtk.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> >
> > --
> > PHP-GTK General Mailing List (http://gtk.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
> --
> PHP-GTK General Mailing List (http://gtk.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>