Nice one Keri Cheers
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf
Of Keri Henare
Sent: Wednesday, 21 April 2010 4:29 p.m.
To: [email protected]
Subject: Re: [phpug] Positive/Negative number formating (currency)
or:
public function amountNice()
{
return abs($this->GetAmount()) . ($this->GetAmount() < 0 ? 'DR' : 'CR');
}
Kind regards,
Keri Henare
---------------------------------------------------
[e] [email protected]
[w] kerihenare.com
[m] (+64) 021 874 552
PLEASE NOTE: I check my email 3 times per day and will respond at these
intervals. For anything urgent please ring me.
---------------------------------------------------
On 21/04/2010, at 4:23 PM, Aaron Cooper wrote:
> For archives:
>
> public function amountNice() {
> if($this->GetAmount()< 0) {
> $suffix = 'DR';
> } else {
> $suffix = 'CR';
> }
>
> $value = abs($this->GetAmount()) . $suffix;
> return $value;
> }
>
> --
> NZ PHP Users Group: http://groups.google.com/group/nzphpug
> To post, send email to [email protected]
> To unsubscribe, send email to
> [email protected]
--
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[email protected]
--
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[email protected]