From f99e0aba70efad0deb907d8e27f09fc9f527c8a4 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Fri, 17 Feb 2023 17:07:50 +0700 Subject: Refactor --- src2/core/utils/currencyFormat.js | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 src2/core/utils/currencyFormat.js (limited to 'src2/core/utils/currencyFormat.js') diff --git a/src2/core/utils/currencyFormat.js b/src2/core/utils/currencyFormat.js new file mode 100644 index 00000000..dadeaec6 --- /dev/null +++ b/src2/core/utils/currencyFormat.js @@ -0,0 +1,8 @@ +export default function currencyFormat(value) { + const currency = new Intl.NumberFormat('id-ID', { + style: 'currency', + currency: 'IDR', + maximumFractionDigits: 0 + }); + return currency.format(value); +} \ No newline at end of file -- cgit v1.2.3