PHP 8.2.30
Preview: formatCurrency.js Size: 378 B
//proc/thread-self/root/home/byroehnu/easetack.com/resources/js/utils/formatCurrency.js

export default function formatCurrency(amount, decimals, locale = 'en-US', currency = undefined) {
    const options = {
        minimumFractionDigits: decimals,
        maximumFractionDigits: decimals
    };

    if (currency) {
        options.style = 'currency';
        options.currency = currency;
    }

    return new Intl.NumberFormat(locale, options).format(amount);
}

Directory Contents

Dirs: 0 × Files: 7

Name Size Perms Modified Actions
1.10 KB lrw-rw-rw- 2025-05-01 06:16:19
Edit Download
378 B lrw-rw-rw- 2025-04-09 10:29:01
Edit Download
206 B lrw-rw-rw- 2025-04-08 04:12:57
Edit Download
664 B lrw-rw-rw- 2025-04-08 04:12:57
Edit Download
1.04 KB lrw-rw-rw- 2025-04-08 04:12:57
Edit Download
156 B lrw-rw-rw- 2025-04-08 04:12:57
Edit Download
253 B lrw-rw-rw- 2025-04-08 04:12:57
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).