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
+2 -2
View File
@@ -3,7 +3,7 @@ import { Box, Button, Container, Paper, Tooltip, Typography } from "@mui/materia
import React from "react";
import { Location } from "../../Locations/Location";
import { Settings } from "../../Settings/Settings";
import { numeralWrapper } from "../../ui/numeralFormat";
import { formatNumberNoSuffix } from "../../ui/formatNumber";
interface IProps {
Location: Location;
@@ -74,7 +74,7 @@ export function Intro(props: IProps): React.ReactElement {
}}
>
<b>Difficulty:&nbsp;</b>
{numeralWrapper.format(props.Difficulty * 33.3333, "0")} / 100
{formatNumberNoSuffix(props.Difficulty * 33.3333)} / 100
{props.Difficulty > 1.5 && (
<Tooltip
title={
+2 -2
View File
@@ -8,7 +8,7 @@ import { Page } from "../../ui/Router";
import { Player } from "@player";
import { Money } from "../../ui/React/Money";
import { Reputation } from "../../ui/React/Reputation";
import { formatNumber } from "../../utils/StringHelperFunctions";
import { formatNumberNoSuffix } from "../../ui/formatNumber";
import {
calculateInfiltratorsRepReward,
calculateSellInformationCashReward,
@@ -66,7 +66,7 @@ export function Victory(props: IProps): React.ReactElement {
You{" "}
{isMemberOfInfiltrators ? (
<>
have gained {formatNumber(infiltrationRepGain, 2)} rep for {FactionNames.ShadowsOfAnarchy} and{" "}
have gained {formatNumberNoSuffix(infiltrationRepGain, 2)} rep for {FactionNames.ShadowsOfAnarchy} and{" "}
</>
) : (
<></>