New source found from dndbeyond.com
This commit is contained in:
@@ -15,6 +15,7 @@ export interface NumberDisplayProps extends HTMLAttributes<HTMLSpanElement> {
|
||||
isModified?: boolean;
|
||||
size?: "large";
|
||||
numberFallback?: ReactNode;
|
||||
useMph?: boolean;
|
||||
}
|
||||
|
||||
export const NumberDisplay: FC<NumberDisplayProps> = ({
|
||||
@@ -23,6 +24,7 @@ export const NumberDisplay: FC<NumberDisplayProps> = ({
|
||||
isModified = false,
|
||||
size,
|
||||
numberFallback = "--",
|
||||
useMph,
|
||||
className,
|
||||
...props
|
||||
}) => {
|
||||
@@ -37,6 +39,9 @@ export const NumberDisplay: FC<NumberDisplayProps> = ({
|
||||
if (number && number % FEET_IN_MILES === 0) {
|
||||
number = number / FEET_IN_MILES;
|
||||
label = `mile${Math.abs(number) === 1 ? "" : "s"}`;
|
||||
if (useMph) {
|
||||
label = "mph";
|
||||
}
|
||||
} else {
|
||||
label = "ft.";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user