diff options
| author | trisusilo <tri.susilo@altama.co.id> | 2023-10-24 03:07:57 +0000 |
|---|---|---|
| committer | trisusilo <tri.susilo@altama.co.id> | 2023-10-24 03:07:57 +0000 |
| commit | e6c0f277f47b6aeaa55a19216615840f61bfeb1e (patch) | |
| tree | ebaef18f5b7d6925f8eddd029df336fe408f6261 /src/core/utils/formatValue.js | |
| parent | bf33b9a9493aeab84e72647fad384bed43feabd5 (diff) | |
| parent | 7c08e60acc68f4fbd3ff6af756aeae7c1e7b866c (diff) | |
Merged in CR/UI (pull request #110)
CR/UI
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} |
