Skip to content

Commit

Permalink
integers only
Browse files Browse the repository at this point in the history
  • Loading branch information
asktree committed Oct 9, 2023
1 parent a9e8d6e commit b52c9be
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions hub/components/EditWalletRules/RulesDetailsInputs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ export function QuorumPercent(props: Props) {
props.onRulesChange?.(newRules);
}}
onRenderValue={(val) => `${val}%`}
step={1}
/>
</div>
</ValueBlock>
Expand Down
2 changes: 1 addition & 1 deletion hub/components/EditWalletRules/SliderValue/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function SliderValue(props: Props) {
/.*?(([0-9]*\.)?[0-9]+).*/g,
'$1',
);
const parsed = parseFloat(text);
const parsed = Math.floor(parseFloat(text));
const value = Number.isNaN(parsed) ? props.min : parsed;
const newValue = Math.max(props.min, value);
setValue(String(props.value)); // this is to force the input to update to the correct value
Expand Down

0 comments on commit b52c9be

Please sign in to comment.