CORP: Change some number formatting to look better (#764)

changed formatCorpStat to formatBigNumber to make big numbers readable
This commit is contained in:
Caldwell 2023-09-01 02:29:04 +02:00 committed by GitHub
parent b7fdcdf35d
commit 7c82221a13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -9,7 +9,7 @@ import { SellProductModal } from "./modals/SellProductModal";
import { ProductMarketTaModal } from "./modals/ProductMarketTaModal"; import { ProductMarketTaModal } from "./modals/ProductMarketTaModal";
import { CancelProductModal } from "./modals/CancelProductModal"; import { CancelProductModal } from "./modals/CancelProductModal";
import { formatBigNumber, formatCorpStat, formatMoney, formatPercent } from "../../ui/formatNumber"; import { formatBigNumber, formatMoney, formatPercent } from "../../ui/formatNumber";
import { isString } from "../../utils/helpers/string"; import { isString } from "../../utils/helpers/string";
import { Money } from "../../ui/React/Money"; import { Money } from "../../ui/React/Money";
@ -67,7 +67,7 @@ export function ProductElem(props: IProductProps): React.ReactElement {
// Limit Production button // Limit Production button
const productionLimit = product.cityData[city].productionLimit; const productionLimit = product.cityData[city].productionLimit;
const limitProductionButtonText = const limitProductionButtonText =
"Limit Production" + (productionLimit !== null ? " (" + formatCorpStat(productionLimit) + ")" : ""); "Limit Production" + (productionLimit !== null ? " (" + formatBigNumber(productionLimit) + ")" : "");
return ( return (
<Paper> <Paper>
@ -109,29 +109,29 @@ export function ProductElem(props: IProductProps): React.ReactElement {
title={ title={
<Typography> <Typography>
Effective rating is calculated from product rating and the quality of materials used <br /> Effective rating is calculated from product rating and the quality of materials used <br />
Rating: {formatCorpStat(product.rating)} <br /> <br /> Rating: {formatBigNumber(product.rating)} <br /> <br />
Quality: {formatCorpStat(product.stats.quality)} <br /> Quality: {formatBigNumber(product.stats.quality)} <br />
Performance: {formatCorpStat(product.stats.performance)} <br /> Performance: {formatBigNumber(product.stats.performance)} <br />
Durability: {formatCorpStat(product.stats.durability)} <br /> Durability: {formatBigNumber(product.stats.durability)} <br />
Reliability: {formatCorpStat(product.stats.reliability)} <br /> Reliability: {formatBigNumber(product.stats.reliability)} <br />
Aesthetics: {formatCorpStat(product.stats.aesthetics)} <br /> Aesthetics: {formatBigNumber(product.stats.aesthetics)} <br />
Features: {formatCorpStat(product.stats.features)} Features: {formatBigNumber(product.stats.features)}
{corp.unlocks.has(CorpUnlockName.MarketResearchDemand) && ( {corp.unlocks.has(CorpUnlockName.MarketResearchDemand) && (
<> <>
<br /> <br />
{"Demand: " + formatCorpStat(product.demand)} {"Demand: " + formatBigNumber(product.demand)}
</> </>
)} )}
{corp.unlocks.has(CorpUnlockName.MarketDataCompetition) && ( {corp.unlocks.has(CorpUnlockName.MarketDataCompetition) && (
<> <>
<br /> <br />
{"Competition: " + formatCorpStat(product.competition)} {"Competition: " + formatBigNumber(product.competition)}
</> </>
)} )}
</Typography> </Typography>
} }
> >
<Typography>Effective rating: {formatCorpStat(product.cityData[city].effectiveRating)}</Typography> <Typography>Effective rating: {formatBigNumber(product.cityData[city].effectiveRating)}</Typography>
</Tooltip> </Tooltip>
</Box> </Box>
<Box display="flex"> <Box display="flex">