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:
@@ -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;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user