summaryrefslogtreecommitdiff
path: root/frontend/app/utils/textUtils.js
diff options
context:
space:
mode:
authorAndrew <saintruler@gmail.com>2019-03-11 21:00:02 +0400
committerAndrew <saintruler@gmail.com>2019-03-11 21:00:02 +0400
commit7e7dd5244e8d26485ad7950a89c04c98c4fef83f (patch)
tree810730c4650392080fb87a78d3b527201e89fe4b /frontend/app/utils/textUtils.js
Initial commit/
Diffstat (limited to 'frontend/app/utils/textUtils.js')
-rw-r--r--frontend/app/utils/textUtils.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/frontend/app/utils/textUtils.js b/frontend/app/utils/textUtils.js
new file mode 100644
index 0000000..589f48f
--- /dev/null
+++ b/frontend/app/utils/textUtils.js
@@ -0,0 +1,5 @@
+function formatNumber(num) {
+ return num > 999 ? `${(num / 1000).toFixed(1)}k` : num;
+}
+
+export default formatNumber;