Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/common/utils/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const Utils = Object.assign({}, BaseUtils, {
}
return null
})
return 100 - total
return parseFloat((100 - total).toFixed(2))
},
calculateRemainingLimitsPercentage(
total: number | undefined,
Expand Down
9 changes: 4 additions & 5 deletions frontend/web/components/mv/VariationValueInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,22 +83,21 @@ export const VariationValueInput: React.FC<VariationValueProps> = ({
</div>
<div className='ml-3' style={{ width: 160 }}>
<InputGroup
type='text'
type='number'
data-test={`featureVariationWeight${Utils.featureStateToValue(
value,
)}`}
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
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}
/>
Expand Down
Loading