From 6bd88bdb765c1ecc0518abeca77eca25bde2857b Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Tue, 17 Oct 2023 14:57:48 +0700 Subject: add lebel product terjual di product card dan product detail, bugfix queri solr untuk filter brand --- src/core/utils/formatValue.js | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/core/utils/formatValue.js (limited to 'src/core/utils/formatValue.js') 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 } -- cgit v1.2.3