Download IMDB-clone-react-redux/src/helpers.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 418 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/f5071caa249115f3b590492f1c8eb471e02aae4b/IMDB-clone-react-redux/src/helpers.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@f5071caa249115f3b590492f1c8eb471e02aae4b/IMDB-clone-react-redux/src/helpers.js
-
curl -L -o helpers.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/f5071caa249115f3b590492f1c8eb471e02aae4b/IMDB-clone-react-redux/src/helpers.js
418 Bytes
| // Convert time to hours and minutes | |
| export const calcTime = (time) => { | |
| const hours = Math.floor(time / 60); | |
| const mins = time % 60; | |
| return `${hours}h ${mins}m`; | |
| } | |
| // Convert a number to money formatting | |
| export const convertMoney = (money) => { | |
| var formatter = new Intl.NumberFormat('en-US', { | |
| style: 'currency', | |
| currency: 'USD', | |
| minimumFractionDigits: 0, | |
| }); | |
| return formatter.format(money); | |
| } |