money_format_alt

Read Time:17 Second

Alternative code snippet for money_format

    function money_format_alt($amount, $decimal, $symbol = '$', $symbol_right = '', $symbol_thousands = ',', $symbol_decimal = '.') {
        if ($amount < 0) return '-'.$symbol . (number_format(abs($amount), $decimal, $symbol_decimal, $symbol_thousands)) . $symbol_right;
        return $symbol.number_format($amount, $decimal, $symbol_decimal, $symbol_thousands).$symbol_right;
    }

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.