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,7 +4,7 @@
*/
import * as React from "react";
import { numeralWrapper } from "../numeralFormat";
import { formatExp, formatThreads } from "../formatNumber";
import Table from "@mui/material/Table";
import TableCell from "@mui/material/TableCell";
@@ -73,7 +73,7 @@ export function RecentScriptAccordion(props: IProps): React.ReactElement {
<Typography> Threads:</Typography>
</TableCell>
<TableCell className={classes.noborder}>
<Typography>{numeralWrapper.formatThreads(recentScript.runningScript.threads)}</Typography>
<Typography>{formatThreads(recentScript.runningScript.threads)}</Typography>
</TableCell>
</TableRow>
<TableRow>
@@ -115,7 +115,7 @@ export function RecentScriptAccordion(props: IProps): React.ReactElement {
<TableCell className={classes.noborder} colSpan={1} />
<TableCell className={classes.noborder} align="left">
<Typography>
&nbsp;{numeralWrapper.formatExp(recentScript.runningScript.onlineExpGained) + " hacking exp"}
&nbsp;{formatExp(recentScript.runningScript.onlineExpGained) + " hacking exp"}
</Typography>
</TableCell>
</TableRow>
@@ -133,7 +133,7 @@ export function RecentScriptAccordion(props: IProps): React.ReactElement {
<TableRow>
<TableCell className={classes.noborder} colSpan={1} />
<TableCell className={classes.noborder} align="left">
<Typography>&nbsp;{numeralWrapper.formatExp(onlineEps) + " hacking exp / sec"}</Typography>
<Typography>&nbsp;{formatExp(onlineEps) + " hacking exp / sec"}</Typography>
</TableCell>
</TableRow>
@@ -151,7 +151,7 @@ export function RecentScriptAccordion(props: IProps): React.ReactElement {
<TableCell className={classes.noborder} colSpan={1} />
<TableCell className={classes.noborder} align="left">
<Typography>
&nbsp;{numeralWrapper.formatExp(recentScript.runningScript.offlineExpGained) + " hacking exp"}
&nbsp;{formatExp(recentScript.runningScript.offlineExpGained) + " hacking exp"}
</Typography>
</TableCell>
</TableRow>