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 0.16

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.

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 distribut

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]

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("% 4d"

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 wa

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 > > &

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 = " "; $stringtopass .=" "; $stringtopass .=" "; $stringtopass .=" Search "; $stringtopass .=" by Borrower"; $stringtopass .=" "; $strin

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 pr

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

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: http://www.php.net

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(

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 i

Re: [PHP] printf

2002-04-10 Thread Alexander Skwar
»Ron Allen« sagte am 2002-04-10 um 13:49:15 +0200 : > I would like it so that it puts a comma for every 3 spaces...Any Uhm, I'd rather use number_format than printf. See http://www.php.net/manual/en/function.number-format.php Alexander Skwar -- How to quote: http://learn.to/quote (german

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

RE: [PHP] printf()?

2001-12-16 Thread Jason Murray
HTML doesn't pay attention to line breaks, thats why you're needing a ... Jason -- Jason Murray [EMAIL PROTECTED] Web Developer, Melbourne IT "Work now, freak later!" > -Original Message- > From: Ray Gaylog [mailto:[EMAIL PROTECTED]] > Sent: Monday, December 17, 2001 3:49 PM > To: PHP

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 ch

Re: [PHP] Printf fails on large files

2001-08-17 Thread Inércia Sensorial Trabalhando
He said no, here's the error: Warning: printf(): too few arguments in /htdocs/content.php on line 20 And here's the code. Remember that only fails on large files: SITUAÇÃO DA CAIXA POSTAL Resultado da Consulta para: . SITUAÇÃO DA CAIXA POSTAL\n\n"); $situacao = `l

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