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
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.
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
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]
[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"
* 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
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
>
>
&
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
>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
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
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
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(
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
»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
> -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
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
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
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
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
19 matches
Mail list logo