Skip to content

Commit

Permalink
Fix mm leaderboard (#87)
Browse files Browse the repository at this point in the history
Fix mm leaderboard
  • Loading branch information
sushilshinde authored Sep 24, 2019
2 parents 1897d4e + e9579aa commit aaf5403
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"lint:js": "./node_modules/.bin/eslint --ext .js,.jsx .",
"test": "npm run lint && npm run jest"
},
"version": "0.7.11-8",
"version": "0.7.11-14",
"dependencies": {
"auth0-js": "^6.8.4",
"config": "^3.2.0",
Expand Down
4 changes: 2 additions & 2 deletions src/utils/submission.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function removeDecimal(num) {
}

function toAcurateFixed(num, decimal) {
const re = new RegExp(`^-?\\d+(?:.\\d{0,${(decimal - 1)}})?`);
const re = new RegExp(`^-?\\d+(?:.\\d{0,${(decimal)}})?`);
return num.toString().match(re)[0];
}

Expand All @@ -24,7 +24,7 @@ function toFixed(num, decimal) {
const result = _.toFinite(toAcurateFixed(num, decimal));
const integerResult = _.toFinite(removeDecimal(num));

if (_.isInteger(integerResult)) {
if (_.isInteger(result)) {
return integerResult;
}
return result;
Expand Down

0 comments on commit aaf5403

Please sign in to comment.