shared-code-percent

This commit is contained in:
Victor Piousbox
2016-04-09 19:27:22 +00:00
parent f4d2184f34
commit 3c784e869a
7 changed files with 136 additions and 41 deletions

View File

@@ -1,12 +1,12 @@
// TODO move to client
module.exports = function(x, y, dir) {
var roundFn;
module.exports = function percent (x, y, dir) {
let roundFn;
switch (dir) {
case "up":
case 'up':
roundFn = Math.ceil;
break;
case "down":
case 'down':
roundFn = Math.floor;
break;
default: