✨ Builds a widget for CodeStats
This commit is contained in:
@@ -79,3 +79,15 @@ export const findCurrencySymbol = (currencyCode) => {
|
||||
if (currencies[code]) return currencies[code];
|
||||
return code;
|
||||
};
|
||||
|
||||
/* Given a large number, will add commas to make more readable */
|
||||
export const putCommasInBigNum = (bigNum) => {
|
||||
const strNum = Number.isNaN(bigNum) ? bigNum : String(bigNum);
|
||||
return strNum.replace(/\B(?=(?:\d{3})+(?!\d))/g, ',');
|
||||
};
|
||||
|
||||
/* Given a large number, will convert 1000 into k for readability */
|
||||
export const showNumAsThousand = (bigNum) => {
|
||||
if (bigNum < 1000) return bigNum;
|
||||
return `${Math.round(bigNum / 1000)}k`;
|
||||
};
|
||||
|
||||
@@ -217,6 +217,7 @@ module.exports = {
|
||||
jokes: 'https://v2.jokeapi.dev/joke/',
|
||||
flights: 'https://aerodatabox.p.rapidapi.com/flights/airports/icao/',
|
||||
rssToJson: 'https://api.rss2json.com/v1/api.json',
|
||||
codeStats: 'https://codestats.net/',
|
||||
},
|
||||
/* URLs for web search engines */
|
||||
searchEngineUrls: {
|
||||
|
||||
Reference in New Issue
Block a user