mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-10-23 10:13:13 +02:00
15 lines
427 B
TypeScript
15 lines
427 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)}%</>);
|
||
|
}
|