summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/utils/formatValue.js11
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}