phaser/v3/src/math/FloorTo.js

12 lines
239 B
JavaScript
Raw Normal View History

var FloorTo = function (value, place, base)
{
if (place === undefined) { place = 0; }
if (base === undefined) { base = 10; }
var p = Math.pow(base, -place);
return Math.floor(value * p) / p;
};
module.exports = FloorTo;