Finally added a format helper, which has been long intended. There may be still be conversion issues, it hasn't been tested much.
git-svn-id: file:///svn-source/pmgr/branches/ledger_transactions_20090605@77 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -5,36 +5,6 @@
|
||||
<?php
|
||||
; // Editor alignment
|
||||
|
||||
function currency($number) {
|
||||
if (!isset($number))
|
||||
return null;
|
||||
|
||||
if ($number < 0)
|
||||
return "($ " . number_format(-1*$number, 2) . ")";
|
||||
else
|
||||
return "$ " . number_format($number, 2);
|
||||
}
|
||||
|
||||
function datefmt($date) {
|
||||
$date_fmt = 'm/d/Y';
|
||||
return ($date
|
||||
? date_format(date_create($date), $date_fmt)
|
||||
: null);
|
||||
}
|
||||
|
||||
function comment($comment) {
|
||||
if (isset($comment) && is_array($comment)) {
|
||||
foreach (array_keys($comment) AS $k) {
|
||||
if (!$comment[$k])
|
||||
unset($comment[$k]);
|
||||
}
|
||||
return implode('; ', $comment);
|
||||
}
|
||||
|
||||
return $comment;
|
||||
}
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
**********************************************************************
|
||||
**********************************************************************
|
||||
@@ -64,7 +34,7 @@ echo $this->element('table',
|
||||
|
||||
<DIV CLASS="infobox">
|
||||
<DIV CLASS="summary balance">
|
||||
Account Balance: <?php echo currency($balance); ?>
|
||||
Account Balance: <?php echo FormatHelper::currency($balance); ?>
|
||||
</DIV>
|
||||
</DIV>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user