diff options
| author | HATEC\SPVDEV001 <tri.susilo@altama.co.id> | 2023-10-17 14:57:48 +0700 |
|---|---|---|
| committer | HATEC\SPVDEV001 <tri.susilo@altama.co.id> | 2023-10-17 14:57:48 +0700 |
| commit | 6bd88bdb765c1ecc0518abeca77eca25bde2857b (patch) | |
| tree | d78bdeff99a8634a15a7c7b0149a6f51a9408213 /src/core | |
| parent | 954be13467b02889414db600fee8e8b7b76cc2aa (diff) | |
add lebel product terjual di product card dan product detail, bugfix queri solr untuk filter brand
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/utils/formatValue.js | 10 |
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 } |
