Download Youtube-Clone/src/utils/convert.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 567 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/f5071caa249115f3b590492f1c8eb471e02aae4b/Youtube-Clone/src/utils/convert.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@f5071caa249115f3b590492f1c8eb471e02aae4b/Youtube-Clone/src/utils/convert.js
-
curl -L -o convert.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/f5071caa249115f3b590492f1c8eb471e02aae4b/Youtube-Clone/src/utils/convert.js
567 Bytes
| function convertToInternationalCurrencySystem(labelValue) { | |
| // Nine Zeroes for Billions | |
| return Math.abs(Number(labelValue)) >= 1.0e9 | |
| ? (Math.abs(Number(labelValue)) / 1.0e9).toFixed(2) + "B" | |
| : // Six Zeroes for Millions | |
| Math.abs(Number(labelValue)) >= 1.0e6 | |
| ? (Math.abs(Number(labelValue)) / 1.0e6).toFixed(2) + "M" | |
| : // Three Zeroes for Thousands | |
| Math.abs(Number(labelValue)) >= 1.0e3 | |
| ? (Math.abs(Number(labelValue)) / 1.0e3).toFixed(2) + "K" | |
| : Math.abs(Number(labelValue)); | |
| } | |
| export default convertToInternationalCurrencySystem; | |