diff --git a/src/NetscriptFunctions.ts b/src/NetscriptFunctions.ts index cfa18dbee..d537ac18f 100644 --- a/src/NetscriptFunctions.ts +++ b/src/NetscriptFunctions.ts @@ -44,7 +44,7 @@ import { workerScripts } from "./Netscript/WorkerScripts"; import { WorkerScript } from "./Netscript/WorkerScript"; import { helpers, assertObjectType } from "./Netscript/NetscriptHelpers"; import { numeralWrapper } from "./ui/numeralFormat"; -import { convertTimeMsToTimeElapsedString } from "./utils/StringHelperFunctions"; +import { convertTimeMsToTimeElapsedString, formatNumber } from "./utils/StringHelperFunctions"; import { LogBoxEvents, LogBoxCloserEvents, LogBoxPositionEvents, LogBoxSizeEvents } from "./ui/React/LogBoxManager"; import { arrayToString } from "./utils/helpers/arrayToString"; import { isString } from "./utils/helpers/isString"; @@ -1134,10 +1134,7 @@ const base: InternalAPI = { if (helpers.failOnHacknetServer(ctx, server)) { return 1; } - helpers.log( - ctx, - () => `returned ${numeralWrapper.formatSkill(server.requiredHackingSkill)} for '${server.hostname}'`, - ); + helpers.log(ctx, () => `returned ${formatNumber(server.requiredHackingSkill, 0)} for '${server.hostname}'`); return server.requiredHackingSkill; }, getServerMaxMoney: (ctx) => (_hostname) => { diff --git a/src/ui/React/CharacterOverview.tsx b/src/ui/React/CharacterOverview.tsx index 212cb5160..39d2143b8 100644 --- a/src/ui/React/CharacterOverview.tsx +++ b/src/ui/React/CharacterOverview.tsx @@ -7,7 +7,7 @@ import createStyles from "@mui/styles/createStyles"; import { numeralWrapper } from "../numeralFormat"; import { Reputation } from "./Reputation"; import { KillScriptsModal } from "./KillScriptsModal"; -import { convertTimeMsToTimeElapsedString } from "../../utils/StringHelperFunctions"; +import { convertTimeMsToTimeElapsedString, formatNumber } from "../../utils/StringHelperFunctions"; import Table from "@mui/material/Table"; import TableBody from "@mui/material/TableBody"; @@ -54,9 +54,7 @@ function Intelligence(): React.ReactElement { Int  - - {numeralWrapper.formatSkill(Player.skills.intelligence)} - + {formatNumber(Player.skills.intelligence, 0)} @@ -350,9 +348,7 @@ export function CharacterOverview({ save, killScripts }: IProps): React.ReactEle Hack  - - {numeralWrapper.formatSkill(Player.skills.hacking)} - + {formatNumber(Player.skills.hacking, 0)} @@ -376,9 +372,7 @@ export function CharacterOverview({ save, killScripts }: IProps): React.ReactEle Str  - - {numeralWrapper.formatSkill(Player.skills.strength)} - + {formatNumber(Player.skills.strength, 0)} @@ -397,9 +391,7 @@ export function CharacterOverview({ save, killScripts }: IProps): React.ReactEle Def  - - {numeralWrapper.formatSkill(Player.skills.defense)} - + {formatNumber(Player.skills.defense, 0)} @@ -418,9 +410,7 @@ export function CharacterOverview({ save, killScripts }: IProps): React.ReactEle Dex  - - {numeralWrapper.formatSkill(Player.skills.dexterity)} - + {formatNumber(Player.skills.dexterity, 0)} @@ -439,9 +429,7 @@ export function CharacterOverview({ save, killScripts }: IProps): React.ReactEle Agi  - - {numeralWrapper.formatSkill(Player.skills.agility)} - + {formatNumber(Player.skills.agility, 0)} @@ -460,9 +448,7 @@ export function CharacterOverview({ save, killScripts }: IProps): React.ReactEle Cha  - - {numeralWrapper.formatSkill(Player.skills.charisma)} - + {formatNumber(Player.skills.charisma, 0)} diff --git a/src/ui/React/ImportSaveRoot.tsx b/src/ui/React/ImportSaveRoot.tsx index a9f2f1525..b98f55037 100644 --- a/src/ui/React/ImportSaveRoot.tsx +++ b/src/ui/React/ImportSaveRoot.tsx @@ -27,7 +27,7 @@ import WarningIcon from "@mui/icons-material/Warning"; import { ImportData, saveObject } from "../../SaveObject"; import { Settings } from "../../Settings/Settings"; -import { convertTimeMsToTimeElapsedString } from "../../utils/StringHelperFunctions"; +import { convertTimeMsToTimeElapsedString, formatNumber } from "../../utils/StringHelperFunctions"; import { numeralWrapper } from "../numeralFormat"; import { ConfirmationModal } from "./ConfirmationModal"; import { pushImportResult } from "../../Electron"; @@ -243,8 +243,8 @@ export function ImportSaveRoot(props: IProps): JSX.Element { Hacking - {numeralWrapper.formatSkill(currentData.playerData?.hacking ?? 0)} - {numeralWrapper.formatSkill(importData.playerData?.hacking ?? 0)} + {formatNumber(currentData.playerData?.hacking ?? 0, 0)} + {formatNumber(importData.playerData?.hacking ?? 0, 0)} {importData.playerData?.hacking !== currentData.playerData?.hacking && (