function ceilTo(value, places){ var power = Math.pow(10, places); return Math.ceil(value * power) / power; } function floorTo(value, places){ var power = Math.pow(10, places); return Math.floor(value * power) / power; }