1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2026-01-14 10:42:56 -05:00

remove format-number.ts

This commit is contained in:
2022-05-19 10:23:43 -04:00
parent d1f0030d3c
commit d288b2d5f5
5 changed files with 145 additions and 144 deletions

View File

@@ -1,11 +0,0 @@
import { siteLocale } from "../config";
// adds thousands separator
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat
export const commafy = (number: number) => {
if (typeof Intl !== "undefined" && typeof Intl.NumberFormat !== "undefined") {
return new Intl.NumberFormat(siteLocale, { useGrouping: true }).format(number);
} else {
return number;
}
};