diff options
| author | trisusilo <tri.susilo@altama.co.id> | 2023-10-20 02:30:39 +0000 |
|---|---|---|
| committer | trisusilo <tri.susilo@altama.co.id> | 2023-10-20 02:30:39 +0000 |
| commit | ac9dde7aec76ea78d4850e2e6a180a52c45c0aa8 (patch) | |
| tree | f8dcff245448b1f2fe6d94466ceb31530a6f79a0 /src/core/utils/formatValue.js | |
| parent | c74b7475c1d0a8a134b8f8316ba0a7054ca022d2 (diff) | |
| parent | 70591a6a132d25656e4404d78d6364e21949e81a (diff) | |
Merged in CR/UI (pull request #105)
filter choices
Diffstat (limited to 'src/core/utils/formatValue.js')
| -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} |
