UI: Added new locale-aware and configurable number formatting (#354)

This commit is contained in:
Snarling
2023-02-11 13:18:50 -05:00
committed by GitHub
parent 1f5546b721
commit b4074328ec
1231 changed files with 4233 additions and 11958 deletions
+4 -4
View File
@@ -31,7 +31,7 @@ import { TableCell } from "../../ui/React/Table";
import TableBody from "@mui/material/TableBody";
import Table from "@mui/material/Table";
import TableRow from "@mui/material/TableRow";
import { numeralWrapper } from "../../ui/numeralFormat";
import { formatRam } from "../../ui/formatNumber";
import { calculateHashGainRate } from "../formulas/HacknetServers";
import Tooltip from "@mui/material/Tooltip";
@@ -273,10 +273,10 @@ export function HacknetServerElem(props: IProps): React.ReactElement {
</span>{" "}
max production rate. (achieved when 100% RAM is allocated to it)
<br />
{numeralWrapper.formatRAM(node.ramUsed)} / {numeralWrapper.formatRAM(node.maxRam)} (
{formatRam(node.ramUsed)} / {formatRam(node.maxRam)} (
{Math.round((100 * node.ramUsed) / node.maxRam)}%) RAM allocated to script.
<br />
{numeralWrapper.formatRAM(node.maxRam - node.ramUsed)} / {numeralWrapper.formatRAM(node.maxRam)} (
{formatRam(node.maxRam - node.ramUsed)} / {formatRam(node.maxRam)} (
{Math.round((100 * (node.maxRam - node.ramUsed)) / node.maxRam)}%) RAM allocated to hash production.
</Typography>
}
@@ -311,7 +311,7 @@ export function HacknetServerElem(props: IProps): React.ReactElement {
<Typography>RAM:</Typography>
</TableCell>
<TableCell>
<Typography>{numeralWrapper.formatRAM(node.maxRam)}</Typography>
<Typography>{formatRam(node.maxRam)}</Typography>
</TableCell>
<TableCell>{upgradeRamButton}</TableCell>
</TableRow>