mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-26 09:33:49 +01:00
UI: Fix clipped numbers when values are too big in Augmentations page (#1250)
This commit is contained in:
parent
b88361921e
commit
19984a6f22
@ -23,14 +23,19 @@ interface IBitNodeModifiedStatsProps {
|
|||||||
color: string;
|
color: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function customFormatPercent(value: number): string {
|
||||||
|
return formatPercent(value, 2, 100);
|
||||||
|
}
|
||||||
|
|
||||||
function BitNodeModifiedStats(props: IBitNodeModifiedStatsProps): React.ReactElement {
|
function BitNodeModifiedStats(props: IBitNodeModifiedStatsProps): React.ReactElement {
|
||||||
// If player doesn't have SF5 or if the property isn't affected by BitNode mults
|
// If player doesn't have SF5 or if the property isn't affected by BitNode mults
|
||||||
if (props.mult === 1 || Player.sourceFileLvl(5) === 0)
|
if (props.mult === 1 || Player.sourceFileLvl(5) === 0)
|
||||||
return <Typography color={props.color}>{formatPercent(props.base)}</Typography>;
|
return <Typography color={props.color}>{customFormatPercent(props.base)}</Typography>;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Typography color={props.color}>
|
<Typography color={props.color}>
|
||||||
<span style={{ opacity: 0.5 }}>{formatPercent(props.base)}</span> {formatPercent(props.base * props.mult)}
|
<span style={{ opacity: 0.5 }}>{customFormatPercent(props.base)}</span>{" "}
|
||||||
|
{customFormatPercent(props.base * props.mult)}
|
||||||
</Typography>
|
</Typography>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user