mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-11 10:13:52 +01:00
fix stock price estimate text when selling
This commit is contained in:
parent
50cfa99b24
commit
4224c7defd
@ -34,16 +34,18 @@ export function SellSharesModal(props: IProps): React.ReactElement {
|
||||
function ProfitIndicator(props: { shares: number | null; corp: ICorporation }): React.ReactElement {
|
||||
if (props.shares === null) return <></>;
|
||||
if (isNaN(props.shares) || props.shares <= 0) {
|
||||
return <>ERROR: Invalid value entered for number of shares to sell</>;
|
||||
return <Typography>ERROR: Invalid value entered for number of shares to sell </Typography>;
|
||||
} else if (props.shares > corp.numShares) {
|
||||
return <>You don't have this many shares to sell!</>;
|
||||
return <Typography>You don't have this many shares to sell! </Typography>;
|
||||
} else {
|
||||
const stockSaleResults = corp.calculateShareSale(props.shares);
|
||||
const profit = stockSaleResults[0];
|
||||
return (
|
||||
<>
|
||||
Sell {props.shares} shares for a total of {numeralWrapper.formatMoney(profit)}
|
||||
</>
|
||||
<Typography>
|
||||
<small>
|
||||
Sell {props.shares} shares for a total of {numeralWrapper.formatMoney(profit)}
|
||||
</small>
|
||||
</Typography>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user