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
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
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
[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(%
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:
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
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 .=
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
* 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
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?
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
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)
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:
HTML doesn't pay attention to line breaks, thats why you're
needing a BR...
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:
-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
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
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
17 matches
Mail list logo