diff options
| author | trisusilo <tri.susilo@altama.co.id> | 2023-10-17 08:40:24 +0000 |
|---|---|---|
| committer | trisusilo <tri.susilo@altama.co.id> | 2023-10-17 08:40:24 +0000 |
| commit | 9ab905837f4da53448e6eefe9ed73bccb890596e (patch) | |
| tree | aa003b45f47de8bdda04105fa3cd1e91b992b27f /src/core/utils | |
| parent | 2ad2f4d39d9b6c3caaedffef7c5c506126c6ee43 (diff) | |
| parent | b29f07808f52d0b9b6ad9c76b182a6ccebb82c5e (diff) | |
Merged in CR/UI (pull request #101)
CR/UI
Diffstat (limited to 'src/core/utils')
| -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 } |
