php-windows Digest 11 Jan 2001 06:25:55 -0000 Issue 390 Topics (messages 4903 through 4915): Re: decimal numbers 4903 by: Tom 4904 by: Simon Willison 4905 by: Boget, Chris Attaching to a PostgreSQL database on a Linux box from a VB app o n NT4 4906 by: Brinkman, Theodore 4907 by: alain samoun Why Do Forms Expire 4908 by: Flint Doungchak Class storage questions 4909 by: IThelp 4910 by: Toby Butzon Search Engine 4911 by: IThelp 4912 by: Toby Butzon getallheaders 4913 by: Tait Grove FDF Cache Question 4914 by: Flint Doungchak Problem with CURSOR under MS SQL 7 4915 by: Mauro Boschi Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] ----------------------------------------------------------------------
$Percent=sprintf("%0.2f",$Percent); afan wrote: > Hi all, > short and simple question: > > >From total of 123 elements 79 are ok. What percent? > > $Total = 123; > $ok = 78; > $Percent = (100 / 123) * 78; // 63.41463414... > > But I need just two decimal: 63.41 > I'm doing it this way: > > $Percent = $Percent * 10; // 6341.463414... > settype($Percent, "integer"); // 6341 > $Percent = $Percent / 10; // 63.41 > > I thing there is much better solution! > > Thanks for help > > Afan
You need to use sprintf or printf to format the output. Here's the necessary code: $Percent = sprintf ("%0.2f", $Percent); If you use printf it will print the result, whereas sprintf (as used above) returns the string and lets you assign it to a variable instead. More info here: http://www.php.net/manual/function.sprintf.php -----Original Message----- From: afan [mailto:[EMAIL PROTECTED]] Sent: 10 January 2001 19:07 To: [EMAIL PROTECTED] Subject: decimal numbers Hi all, short and simple question: >From total of 123 elements 79 are ok. What percent? $Total = 123; $ok = 78; $Percent = (100 / 123) * 78; // 63.41463414... But I need just two decimal: 63.41 I'm doing it this way: $Percent = $Percent * 10; // 6341.463414... settype($Percent, "integer"); // 6341 $Percent = $Percent / 10; // 63.41 I thing there is much better solution! Thanks for help Afan
> You need to use sprintf or printf to format the output. Here's the > necessary code: > $Percent = sprintf ("%0.2f", $Percent); > If you use printf it will print the result, whereas sprintf > (as used above) returns the string and lets you assign it to a variable > instead. > More info here: http://www.php.net/manual/function.sprintf.php Or you can use number_format() and you won't have to remember all those printf() formatting strings... :p Chris
I think the subject pretty much says it all. I need help setting up things on both ends to let a VB app (on Windows, obviously) connect to a PostgreSQL database on a Linux box. Any help appreciated. - Theo Sorry about cross-posting to the two lists, but I figured it was pertinent to both.
See WDDX Alain "Brinkman, Theodore" wrote: > > I think the subject pretty much says it all. I need help setting up things > on both ends to let a VB app (on Windows, obviously) connect to a PostgreSQL > database on a Linux box. > > Any help appreciated. > > - Theo > > Sorry about cross-posting to the two lists, but I figured it was pertinent > to both. > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED]
Hi All, Although there are no stupid questions, I have one. Can anyone explain why pages exipre in IE 5.5? For instance, when I click a submit button and then click back, say so people can edit the dang form, the message of Warning: page expired thingy comes up. Is there a way to keep that from happening? I hate that message and never got around to fixing the problem. Thanks, -Flint
I have two classes. Class box is basically a sub class that is only called from the Class Print. The problem is I would like to have an array in Class Print that will store instances of Class box. example class Print{ var arrayofboxes = array(); //other stuff $tempbox = $this->arrayofboxes[0]; //supposed to load a box $tembox->getinfo(); } class Box{ box(){ //various info } getinfo(){ } //other stuff } When I go to unload the box out of array into $tempbox nothing is there. Where happened that instance and where can I get the info about that class. ryan
<snip> > example > > class Print{ > > var arrayofboxes = array(); ...arrayofboxes is an empty array? Where does it get anything put in it? --Toby <snip>
I am looking for a search engine that will shift through a sql server 7.0 for data. If anyone knows of any packages like that please let me know. Ryan Conover
It's not that hard to implement, really... the sifting should all be done by the server... all you have to do is formulate a good query... SELECT * FROM myTable WHERE textField LIKE '%search string%' --Toby ----- Original Message ----- From: "IThelp" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, January 10, 2001 3:28 PM Subject: [PHP-WIN] Search Engine > I am looking for a search engine that will shift through a sql server 7.0 > for data. If anyone knows of any packages like that please let me know. > > Ryan Conover > > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
is there a function that works like the apache module 'getallheaders' in IIS?
I am working on developing a FDF document with data from a database. The problem I am experiencing is when a user clicks on the link to my fdf generator, they are able to dnload the fdf document, and the browser opens acrobat reader. The error occurs within acrobat, simly saying that the file does not exist. However, if the user chooses to save the fdf document to disk, then open the fdf document localy, acrobat reader works correctly. Does anyone know why the document can not be opened from the browser, but can be opened localy? and is there a soultion so that the fdf doc will open correctly inside the browser? Thanks Patrick Shafer [EMAIL PROTECTED] _________________________________________________ Flint Doungchak, President Net Solutions, LLC 840 Lawrence Street Eugene, OR 97401 [EMAIL PROTECTED] Voice +1 541 345-7087 Fax +1 541 485-5519 http://www.netsolutionsllc.com
Hi, I'm trying to understand why something like this: DECLARE crs CURSOR KEYSET FOR SELECT title FROM article WHERE pub_id = 1 OPEN crs FETCH ABSOLUTE 3 FROM crs DECLARE @var INT SET @var = 0 WHILE (@var<10) BEGIN FETCH NEXT FROM crs SET @var = @var +1 END CLOSE crs DEALLOCATE crs Doesn't work when you try to embend it in a PHP/MSSQL query!? There's something that I doesn't mind about this? Maybe a LOCAL PROCEDURE works better? What I have to do is just emulate the LIMIT function that MySQL have in his set of command. This function is very useful when you have to extract only a set of row from the query with an absolute start position. THANKS A LOT Mauro -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]