fixing an issue with the break evens where if the bushel price or yield target were not set it would try to divide by 0 and get infinity, now it will just display 0 if not set
This commit is contained in:
parent
85568e6ce5
commit
af90e8893c
1 changed files with 6 additions and 6 deletions
|
|
@ -58,25 +58,25 @@ export default function HarvestPlanDisplay(props: Props) {
|
||||||
<Grid container direction="column">
|
<Grid container direction="column">
|
||||||
<Grid className={classes.dark}>
|
<Grid className={classes.dark}>
|
||||||
<Box style={{ display: "flex", justifyContent: "space-between" }}>
|
<Box style={{ display: "flex", justifyContent: "space-between" }}>
|
||||||
<Typography variant="subtitle1">Break Even Yield:</Typography>
|
<Typography variant="subtitle1">Break Even Yield (acre):</Typography>
|
||||||
<Typography variant="subtitle1">
|
<Typography variant="subtitle1">
|
||||||
{(
|
{plan.bushelPrice() !== 0 ? (
|
||||||
(plan.totalEquipmentCost() + plan.totalMaterialCost()) /
|
(plan.totalEquipmentCost() + plan.totalMaterialCost()) /
|
||||||
plan.bushelPrice()
|
plan.bushelPrice()
|
||||||
).toFixed(2)}{" "}
|
).toFixed(2) : 0}{" "}
|
||||||
BU
|
BU
|
||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid className={classes.light}>
|
<Grid className={classes.light}>
|
||||||
<Box style={{ display: "flex", justifyContent: "space-between" }}>
|
<Box style={{ display: "flex", justifyContent: "space-between" }}>
|
||||||
<Typography variant="subtitle1">Break Even Sales Price</Typography>
|
<Typography variant="subtitle1">Break Even Sales Price (BU):</Typography>
|
||||||
<Typography variant="subtitle1">
|
<Typography variant="subtitle1">
|
||||||
$
|
$
|
||||||
{(
|
{plan.yieldTarget() !== 0 ? (
|
||||||
(plan.totalEquipmentCost() + plan.totalMaterialCost()) /
|
(plan.totalEquipmentCost() + plan.totalMaterialCost()) /
|
||||||
plan.yieldTarget()
|
plan.yieldTarget()
|
||||||
).toFixed(2)}
|
).toFixed(2) : 0}
|
||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue