refactor: course list data

This commit is contained in:
Jannat Patel
2024-10-30 22:12:59 +05:30
parent 19b759e9fb
commit 8640ecf9be
18 changed files with 299 additions and 167 deletions

View File

@@ -57,6 +57,15 @@ export function formatNumberIntoCurrency(number, currency) {
return ''
}
// create a function that formats numbers in thousands to k
export function formatAmount(amount) {
if (amount > 999) {
return (amount / 1000).toFixed(1) + 'k'
}
return amount
}
export function convertToTitleCase(str) {
if (!str) {
return ''