Created
April 6, 2021 19:21
-
-
Save neodigm/5eb3971895ca6acd66f13aa51cae5514 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const kFormat = (num) => | |
Math.abs(num) > 999 | |
? Math.sign(num) * (Math.abs(num) / 1000).toFixed(1) + 'k' | |
: Math.sign(num) * Math.abs(num) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment