Re: [PHP] printf and number_format rounding

2006-05-04 Thread Richard Lynch
On Wed, May 3, 2006 12:25 pm, Duffy, Scott E wrote: Are printf and number_format supposed to round? echo ($hcount-$lcount)/$hilow. ; echo number_format(($hcount-$lcount)/$hilow,2,'.',''); 0.208333 0.21 0.145833 0.15 0.17 0.17

Re: [PHP] printf and number_format rounding

2006-05-04 Thread Barry
Richard Lynch schrieb: On Wed, May 3, 2006 12:25 pm, Duffy, Scott E wrote: Are printf and number_format supposed to round? echo ($hcount-$lcount)/$hilow. ; echo number_format(($hcount-$lcount)/$hilow,2,'.',''); 0.208333 0.21 0.145833 0.15

[PHP] printf and number_format rounding

2006-05-03 Thread Duffy, Scott E
Are printf and number_format supposed to round? echo ($hcount-$lcount)/$hilow. ; echo number_format(($hcount-$lcount)/$hilow,2,'.',''); 0.208333 0.21 0.145833 0.15 0.17 0.17 0.083 0.08 Printf

Re: [PHP] printf() in a variable, or alternative to printf()

2005-06-01 Thread Richard Lynch
http://php.net/sprintf On Thu, May 26, 2005 8:35 pm, mayo said: I need to be able to format data. Printf() is perfect because I need a certain amount of characters (30 for address). However I need this formatted data to be inside a file that's fwrite() and then FTPed to a distributor who

[PHP] printf() in a variable, or alternative to printf()

2005-05-27 Thread mayo
I need to be able to format data. Printf() is perfect because I need a certain amount of characters (30 for address). However I need this formatted data to be inside a file that's fwrite() and then FTPed to a distributor who will parse it and input into their database. printf(%

RE: [PHP] printf() in a variable, or alternative to printf()

2005-05-27 Thread Jay Blanchard
[snip] I need to be able to format data. Printf() is perfect because I need a certain amount of characters (30 for address). However I need this formatted data to be inside a file that's fwrite() and then FTPed to a distributor who will parse it and input into their database. printf(%

RE: [PHP] printf() in a variable, or alternative to printf() - SOLVED

2005-05-27 Thread mayo
Thx, It's amazing how sleep helps. Couldn't believe that when I read sprintf() I didn't see how it did exactly what I was looking for. Thx all mayo -Original Message- From: mayo [mailto:[EMAIL PROTECTED] Sent: Thursday, May 26, 2005 11:35 PM To: php-general@lists.php.net Subject: [PHP

[PHP] printf....

2003-10-01 Thread Dan Joseph
Hi Folks.. printf ( html body center form action=\%s\ method=post name=\frmSearch\ input type=hidden name=search value=yes table

Re: [PHP] printf....

2003-10-01 Thread Mike Migurski
Warning: printf(): too few arguments in /home/sites/site8/web/index_test.php on line 34 I cannot for the life of me figure out what the problem is. I've looked thru archives, examples, and pages of a book all about printf, and this just doesn't add up to me.. Anyone see the problem? To print a

Re: [PHP] printf....

2003-10-01 Thread Chris Sherwood
well for starters dan I would pass the first element as a string variable that way I could echo the string and see what it actually says ie $stringtopass = htmlbody center; $stringtopass .= form action=\%s\ method=post name=\frmSearch\input type=hidden name=search value=yes; $stringtopass .=

RE: [PHP] printf....

2003-10-01 Thread Dan Joseph
OH! Heh... learn something new everyday.. Thank you! -Dan Joseph -Original Message- From: Mike Migurski [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 01, 2003 3:49 PM To: Dan Joseph Cc: [EMAIL PROTECTED] Subject: Re: [PHP] printf Warning: printf(): too few

Re: [PHP] printf....

2003-10-01 Thread Curt Zirzow
* Thus wrote Dan Joseph ([EMAIL PROTECTED]): Hi Folks.. [... messy code that probably had a width=something% in it ...] I have that code, and I get this error: Warning: printf(): too few arguments in /home/sites/site8/web/index_test.php on line 34 Curt -- I used to think I was

[PHP] printf %d

2002-12-13 Thread William Martell
Hello All. Can anyone tell me what this '%d' refers to? A pointer would be great. Thanks [snip] if (!$result) die (Query Failed\n); else printf (Number of rows returned: %d\nbrbr, -HERE '%d' mysql_num_rows ($result)); while ($query_data = mysql_fetch_array ($result))

Re: [PHP] printf %d

2002-12-13 Thread Brad Bonkoski
Read: http://www.php.net/manual/en/function.printf.php (On of the user contrib notes has an example) Or pick up a copy of The C Programming Language by Kernighan and Ritchie for a more complete description. -Brad William Martell wrote: Hello All. Can anyone tell me what this '%d' refers to?

[PHP] printf()

2002-06-15 Thread Gerard Samuel
Im trying to make a dynamic printf(). By that I mean - function this($foo, $bar) { if (strlen($bar) == '0') { print($foo); } else { printf($foo, $bar); } } Now it works if there is one argument passed, but it doesn't when there is more than one. $str =

Re: [PHP] printf()

2002-06-15 Thread Danny Shepherd
On Sunday 16 June 2002 12:46 am, Gerard Samuel wrote: Im trying to make a dynamic printf(). By that I mean - function this($foo, $bar) { if (strlen($bar) == '0') { print($foo); } else { printf($foo, $bar); } } Now it works if there is one

Re: [PHP] printf()

2002-06-15 Thread Gerard Samuel
Well I figured out a solution. Using a combination of explode() to create an array from $bar, check to see if $bar is an array and feed the array to vprintf() Gerard Samuel wrote: Im trying to make a dynamic printf(). By that I mean - function this($foo, $bar) { if (strlen($bar)

Re: [PHP] printf()

2002-06-15 Thread Danny Shepherd
On Sunday 16 June 2002 1:13 am, Gerard Samuel wrote: check to see if $bar is an array and feed the array to vprintf() Wow, didn't even know that one existed! Might come in handy though :) Danny. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP] printf

2002-04-10 Thread Ron Allen
I am looking at how to format output Here is what I have. There is a simple currency conversion that I do and the output is just a string of numbers I would like it so that it puts a comma for every 3 spaces...Any clues..oh knowing newsgroup -- PHP General Mailing List

[PHP] printf()?

2001-12-16 Thread Ray Gaylog
Hi.. I've been using PHP for just a little while, however I have noticed somthing. In the doc's I've noticed you can do this: printf(line1 \n line2 \n); Now..this should (like C) print two seperate lines..however It doesn't. To print this on seperate lines I must put a BR in there. Any

RE: [PHP] printf()?

2001-12-16 Thread Jason Murray
To: PHP_Mailing_List Subject: [PHP] printf()? Hi.. I've been using PHP for just a little while, however I have noticed somthing. In the doc's I've noticed you can do this: printf(line1 \n line2 \n); Now..this should (like C) print two seperate lines..however It doesn't. To print

RE: [PHP] printf()?

2001-12-16 Thread Mark Charette
-Original Message- From: Ray Gaylog [mailto:[EMAIL PROTECTED]] I've been using PHP for just a little while, however I have noticed somthing. In the doc's I've noticed you can do this: printf(line1 \n line2 \n); Now..this should (like C) print two seperate lines..however It

[PHP] printf scientific notation?

2001-10-03 Thread Bill Rausch
I'll try this again, with a new topic and a better description. Can PHP print floating point numbers using scientific notation? (like 1.32e+5) sscanf reads them ok using %f, but I'd like to print them with %e or %g and the printf documentation doesn't mention them. I've tried %e anyway and it

Re: [PHP] Printf fails on large files

2001-08-18 Thread Moriyoshi Koizumi
Hello, I don't think the problem you have is not the size of the file. It seems to depend on the content of that. (line 1) $a = 'abc%d'; (line 2) printf( "$a" ); will cause too-few-arguments error because variable $a contains the sequence of '%','d', which should be interpreted as formatting

[PHP] Printf fails on large files

2001-08-17 Thread Inércia Sensorial Trabalhando
Hi All, A friend of mine said his printf is failing when he parses a variable from a 4.5 mega file. On smaller files, it works fine. There's a limit on the printf or somewhere else? Thanks. -- Julio Nobrega A hora está chegando: http://toca.sourceforge.net -- PHP General Mailing

Re: [PHP] Printf fails on large files

2001-08-17 Thread John Meyer
At 05:14 PM 8/17/01 -0300, Inércia Sensorial Trabalhando wrote: Hi All, A friend of mine said his printf is failing when he parses a variable from a 4.5 mega file. On smaller files, it works fine. There's a limit on the printf or somewhere else? Thanks. Is he throwing the