[PHP] Rounding issue
I need to know if there is a work around for the following scenerio... $x = 4.5012412; echo round($x, 2); // results in 4.5 --- however I want 4.50! I want 2 decimal places! Is there a way to keep the zero from being dropped? I have not been able to get the zero to stay there ... I realize this is the interpreters problem but I need the zero. thanks in advance -- Kevin Ison Charlotte, NC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Rounding issue
ahhh ok thanks guys!! That worked ... I knew it was something but I could not remember which function... thanks again! "Larry E . Ullman" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > $x = 4.5012412; > > echo round($x, 2); // results in 4.5 --- however I want 4.50! I > > want 2 > > decimal places! > > echo number_format ( round ($x, 2), 2); > > Larry > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Rounding issue
ahhh ok thanks guys!! That worked ... I knew it was something but I could not remember which function... thanks again! "Curt Zirzow" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > * Thus wrote Kevin Ison ([EMAIL PROTECTED]): > > I need to know if there is a work around for the following scenerio... > > > > $x = 4.5012412; > > echo round($x, 2); // results in 4.5 --- however I want 4.50! I want 2 > > decimal places! > > > > > > > > Is there a way to keep the zero from being dropped? I have not been able to > > get the zero to stay there ... I realize this is the interpreters problem > > but I need the zero. > > number_format(round($x, 2),2); > > you can always control with printf functions, but number format is > designed specifically for that. > > > Curt > -- > "I used to think I was indecisive, but now I'm not so sure." -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] need help with using java in PHP
ok heres the scenerio: php.ini: [Java] java.class.path = C:\apache\php\JAVA\php_java.jar;c:\apache\htdocs\ktest\;. java.home = C:\j2sdk1.4.1_01\bin\ java.library = C:\j2sdk1.4.1_01\jre\bin\server\jvm.dll java.library.path = C:\apache\php\extensions\;C:\apache\php\;.\ the PHP source code: exists()) { echo "File path is ".$myClass->getAbsolutePath().""; } else { echo " blah no workie "; } ?> resulting output: Warning: java.lang.ClassNotFoundException: java.io.file in c:\apache\htdocs\ktest\xzerror.php on line 13 Fatal error: Call to a member function on a non-object in c:\apache\htdocs\ktest\xzerror.php on line 23 I got the idea from something I saw a while back on a PHP tutorial my question is, why doesnt this work. I think I have the PHP.INI file set up correctly. thanks -- Kevin Ison Charlotte, NC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php editor?
now theres a sadistic way to code! I used to use vi... to be honest I like it. but on a windows platform crimson editor works well. "Gerard Samuel" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Because some of us, work directly on the server, instead of modifying > files, then uploading to the server to test :) > > electroteque wrote: > > >boy how painfully dweebish is vi why make it harder for yourself :O > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php editor?
personnaly I kind of grew up on vi many many moons ago "Tom Ray" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Why not just use PICO? > > Kevin Ison wrote: > > >now theres a sadistic way to code! I used to use vi... to be honest I like > >it. but on a windows platform crimson editor works well. > > > >"Gerard Samuel" <[EMAIL PROTECTED]> wrote in message > >news:[EMAIL PROTECTED] > > > > > >>Because some of us, work directly on the server, instead of modifying > >>files, then uploading to the server to test :) > >> > >>electroteque wrote: > >> > >> > >> > >>>boy how painfully dweebish is vi why make it harder for yourself :O > >>> > >>> > >>> > > > > > > > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Problem to start apache after installed PHP.
sounds like something was not initialized during your linux boot up I havent run linux in a while but I seem to remember that after I compile my applications I had to run another utility to make my new library active. In fact the same utility is/was part of my boot up commands in the RC files. gr for some reason i keep thinking ldconfig but I dont think thats it. The utility updates a library table. sorry if this is still unclear... "Niklas Janzon" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi .. i got a problem to restart my apache (2.0.46) server on my linux > system after i installed PHP 4.3.2. > I get this message: > > [EMAIL PROTECTED]:/usr/local/apache2/bin/ > ./apachectl restart > > Syntax error on line 232 of /usr/local/apache2/conf/httpd.conf: > Cannot load /usr/libexec/libphp4.so into server: > /usr/libexec/libphp4.so: undefined symbol: ap_block_alarms > > Anyone got any idea on this? > > Kind regards > Niklas Janzon > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php