|
Posted by Rami Elomaa on 04/02/07 10:33
Man-wai Chang kirjoitti:
>
> in the php:
>
> $total=0.00;
> for (...) {
> $total=$total+round(....,2);
> }
> $theclass = new Template();
> $theclass->assign('po_total', $total);
>
> in the template:
>
> <td width="8%" class="textbox1"><input readonly class="textbox1"
> type="textbox" name="txtPoTotal" id="txtPoTotal" align="right"
> value={$po_total|string_format:"%2.f"} maxlength=10 size=10>
>
> The webpage shows "15.000000", rather than "15.00".
I'm guessing it has something to do with this: string_format:"%2.f", I
suppose you wanted %.2f instead of %2.f , notice where the decimal
point is.
http://smarty.php.net/manual/en/language.modifier.string.format.php
--
Rami.Elomaa@gmail.com
"Olemme apinoiden planeetalla."
Navigation:
[Reply to this message]
|