diff options
| author | HATEC\SPVDEV001 <tri.susilo@altama.co.id> | 2023-10-20 09:29:48 +0700 |
|---|---|---|
| committer | HATEC\SPVDEV001 <tri.susilo@altama.co.id> | 2023-10-20 09:29:48 +0700 |
| commit | 70591a6a132d25656e4404d78d6364e21949e81a (patch) | |
| tree | d496a77e272f5bc9f9aecc84082747720d045e2d /src/core/utils | |
| parent | 2a84fb3ce03cfa46cb3c7664e988957e1bd2731b (diff) | |
filter choices
Diffstat (limited to 'src/core/utils')
| -rw-r--r-- | src/core/utils/formatValue.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/core/utils/formatValue.js b/src/core/utils/formatValue.js index f2c17769..f0f65c69 100644 --- a/src/core/utils/formatValue.js +++ b/src/core/utils/formatValue.js @@ -7,4 +7,13 @@ const sellingProductFormat = (value) => { } } -export { sellingProductFormat } +const formatCurrency = (value) => { + if (value >= 1000) { + const thousands = Math.floor(value / 1000) // Menghitung ribuan + return `Rp${thousands}k` + } else { + return `Rp${value}` + } +} + +export { sellingProductFormat, formatCurrency} |
