Skip to content

Commit

Permalink
Fix normalizeValue in Number input
Browse files Browse the repository at this point in the history
  • Loading branch information
artf committed Nov 1, 2017
1 parent 658f68f commit a585c7d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dist/grapes.min.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/domain_abstract/ui/InputNumber.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@ module.exports = Input.extend({
value = parseFloat(value);

if (Math.floor(value) !== value) {
stepDecimals = step.toString().split('.')[1].length || 0;
const side = step.toString().split('.')[1];
stepDecimals = side ? side.length : 0;
}

return stepDecimals ? parseFloat(value.toFixed(stepDecimals)) : value;
Expand Down

0 comments on commit a585c7d

Please sign in to comment.