Your code doesn't make much sense to me, and especially not with
respect to the question. I give you some comments below.
Arnab (WebMaster) schrieb am Mittwoch, 25. Juli 2001, 09:23:39:
How to round the result number after the multiplication,
below are the PHP codes,
any help greatly appreciated
?php
If (@$rcurr ==)
@ doesn't make sense here. It is used with functions to suppress
error messages.
{ echo ();
This doesn't make any sense at all. If you don't want any out put
then don't do anything. If you have a if/else construct without
action you can insert a comment like this
if(...){
//nothing to do
}
else{
.
}
Better: leave that thing alone and write
if (!...){
}
?
?php
I hope you open your table somwhere.
while ( $row = mysql_fetch_array($result) )
{ echo(tr);
echo(td . $row[Room_Category] . /td);
echo(td . $row[Room_Size] . /td);
echo(td align='right' . $row[xsp] . /td);
echo(td align='right' . $row[xan] . /td);
echo(/tr);
}
echo(/table);
You close your table in any case, so you better put that outside
your if/else-stuff.
?
?php
}
else
{
?
?php
while ( $row = mysql_fetch_array($result) )
{ echo(tr);
echo(td . $row[Room_Category] . /td);
echo(td . $row[Room_Size] . /td);
echo(td align='right' . $row[xsp]*$rcurr . /td);
echo(td align='right' . $row[xan]*$rcurr . /td);
echo(/tr);
}
echo(/table);
}
?
Write yourself a function like roundCurr() and then insert
roundCurr($row[xan]*$rcurr) instead. To get a hint, how to do
that, look at php.net and do a little research. You want to
behave your reound function in a certain way, and it can be done
very elegantly, as I remember, but I don't remember how and I
don't want to do the work for you..
-
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
--
Herzlich
Werner Stuerenburg
_
ISIS Verlag, Teut 3, D-32683 Barntrup-Alverdissen
Tel 0(049) 5224-997 407 ยท Fax 0(049) 5224-997 409
http://pferdezeitung.de
-
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php