mirror of
https://github.com/aljazceru/landscape-template.git
synced 2026-01-23 08:14:28 +01:00
bug: handle edge case in numberFormatter
This commit is contained in:
@@ -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: "" },
|
||||
|
||||
Reference in New Issue
Block a user