Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 2 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
19 | public static function execute(float $amount, |
||
20 | int $decimals = 2, |
||
21 | string $thousands_sep = '', |
||
22 | bool $dollar_sign_prefix = false): string |
||
23 | { |
||
24 | // Format $amount |
||
25 | $value = number_format($amount, $decimals, '.', $thousands_sep); |
||
26 | |||
27 | // Optionally prefix the value with a dollar sign |
||
28 | return $dollar_sign_prefix ? "$".$value : $value; |
||
29 | } |
||
31 |