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
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
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
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(%
[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: [PHP
Hi Folks..
printf (
html
body
center
form action=\%s\ method=post name=\frmSearch\
input type=hidden name=search value=yes
table
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
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))
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?
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 =
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:
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
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
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
-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
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
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
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
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
26 matches
Mail list logo