summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/utils/formatValue.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/core/utils/formatValue.js b/src/core/utils/formatValue.js
new file mode 100644
index 00000000..dc78df5b
--- /dev/null
+++ b/src/core/utils/formatValue.js
@@ -0,0 +1,10 @@
+const sellingProductFormat = (value) => {
+ if (value > 1000) {
+ const formattedValue = (value / 1000).toFixed(1).replace('.', ',')
+ return `${formattedValue.replace(/\.0$/, '')}rb+`
+ } else {
+ return value.toString()
+ }
+}
+
+export { sellingProductFormat }