PluginProbe
Easy Invoice – Invoice Generator, PDF Quotes & Payments / 2.3.2
Easy Invoice – Invoice Generator, PDF Quotes & Payments v2.3.2
2.4.0 2.4.1 2.3.8 2.3.7 2.3.6 2.3.5 2.3.4 2.3.3 2.3.2 2.3.1 2.2.0 2.1.21 2.1.20 2.1.19 2.1.18 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.16 2.1.2 All 57 releases
easy-invoice / includes / Helpers / InvoiceFormatter.php

InvoiceFormatter.php in Easy Invoice – Invoice Generator, PDF Quotes & Payments 2.3.2, at includes/Helpers/InvoiceFormatter.php

46 lines 841 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Invoice Formatter Helper Class
4 *
5 * @package Easy_Invoice
6 * @subpackage Helpers
7 */
8
9 namespace EasyInvoice\Helpers;
10
11 use EasyInvoice\Traits\CurrencyTrait;
12
13 /**
14 * Invoice Formatter Class
15 *
16 * Handles formatting of invoice values
17 */
18 class InvoiceFormatter {
19 use CurrencyTrait;
20
21 /**
22 * The invoice object
23 *
24 * @var mixed
25 */
26 private $invoice;
27
28 /**
29 * Constructor
30 *
31 * @param mixed $invoice The invoice object
32 */
33 public function __construct($invoice = null) {
34 $this->invoice = $invoice;
35 }
36
37 /**
38 * Format a currency amount
39 *
40 * @param float $amount The amount to format
41 * @return string The formatted amount
42 */
43 public function format($amount) {
44 return $this->formatCurrency($amount, $this->invoice);
45 }
46 }