bitburner-src/src/Bladeburner/ui/SuccessChance.tsx
2021-09-04 19:09:30 -04:00

20 lines
451 B
TypeScript

import React from "react";
import { formatNumber } from "../../../utils/StringHelperFunctions";
interface IProps {
chance: number[];
}
export function SuccessChance(props: IProps): React.ReactElement {
if (props.chance[0] === props.chance[1]) {
return <>{formatNumber(props.chance[0] * 100, 1)}%</>;
}
return (
<>
{formatNumber(props.chance[0] * 100, 1)}% ~{" "}
{formatNumber(props.chance[1] * 100, 1)}%
</>
);
}