diff --git a/frontend/common/utils/utils.tsx b/frontend/common/utils/utils.tsx index 7ffcf3d4df2e..8eda3042cd21 100644 --- a/frontend/common/utils/utils.tsx +++ b/frontend/common/utils/utils.tsx @@ -96,7 +96,7 @@ const Utils = Object.assign({}, BaseUtils, { } return null }) - return 100 - total + return parseFloat((100 - total).toFixed(2)) }, calculateRemainingLimitsPercentage( total: number | undefined, diff --git a/frontend/web/components/mv/VariationValueInput.tsx b/frontend/web/components/mv/VariationValueInput.tsx index f4dc8ce88fbb..9102dd4829c8 100644 --- a/frontend/web/components/mv/VariationValueInput.tsx +++ b/frontend/web/components/mv/VariationValueInput.tsx @@ -83,22 +83,21 @@ export const VariationValueInput: React.FC = ({
) => { + const val = Utils.safeParseEventValue(e) onChange({ ...value, - default_percentage_allocation: Utils.safeParseEventValue(e) - ? parseInt(Utils.safeParseEventValue(e)) - : null, + default_percentage_allocation: val ? parseFloat(val) : null, }) }} value={value.default_percentage_allocation} inputProps={{ - maxLength: 3, readOnly: disabled, + step: 'any', }} title={weightTitle} />