diff options
author | Jonathan Prykop <jonathan@freeside.biz> | 2015-07-06 21:16:33 -0500 |
---|---|---|
committer | Jonathan Prykop <jonathan@freeside.biz> | 2015-07-06 22:22:32 -0500 |
commit | 0431b7a1654c5eebaa9d8cc5c6b0de8494687e59 (patch) | |
tree | 56aa228a367f2e96e3d8d432386ae04eed9b853b /FS/FS/Misc.pm | |
parent | 76ee5744397527a0f9421972b4c93aaeed7ba26f (diff) |
RT#24684: Payments for Online Bill Pay [Credit Balance Display]
Diffstat (limited to 'FS/FS/Misc.pm')
-rw-r--r-- | FS/FS/Misc.pm | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/FS/FS/Misc.pm b/FS/FS/Misc.pm index 9aeff93..e1f654c 100644 --- a/FS/FS/Misc.pm +++ b/FS/FS/Misc.pm @@ -23,6 +23,7 @@ use Encode; csv_from_fixed ocr_image bytes_substr + money_pretty ); $DEBUG = 0; @@ -828,7 +829,7 @@ sub _pslatex { } return if -e "$file.dvi" && -s "$file.dvi"; - die "pslatex $file.tex failed; see $file.log for details?\n"; + die "pslatex $file.tex failed, see $file.log for details?\n"; } @@ -982,6 +983,22 @@ sub bytes_substr { return Encode::decode('utf8', $bytes, $chk); } +=item money_pretty + +Accepts a postive or negative numerical value. +Returns amount formatted for display, +including money character. + +=cut + +sub money_pretty { + my $amount = shift; + my $money_char = $conf->{'money_char'} || '$'; + $amount = sprintf("%0.2f",$amount); + $amount =~ s/^(-?)/$1$money_char/; + return $amount; +} + =back =head1 BUGS |