bug: handle edge case in numberFormatter

This commit is contained in:
MTG2000
2022-05-26 20:31:35 +03:00
parent 113ec18479
commit 5ad84a7357

View File

@@ -1,5 +1,6 @@
import React, { ComponentProps, ComponentType, ReactNode, Suspense } from "react";
import { RotatingLines } from "react-loader-spinner";
import { isNullOrUndefined } from "remirror";
export function random(min: number, max: number) {
return Math.random() * (max - min) + min;
@@ -18,7 +19,7 @@ export function isMobileScreen() {
}
export function numberFormatter(num?: number, digits = 1) {
if (!num) return;
if (isNullOrUndefined(num)) return;
const lookup = [
{ value: 1, symbol: "" },