right-pad replaces Math.floor
, Math.ceil
, and Math.round
with much more
apt implementations. right-pad, like
left-pad, may break your dependencies.
Math.floor(10.5);
// =>
// │
// │
// │
// │
// │
// |_____10.5_____
$ npm install zachlatta/right-pad
require('right-pad');
Math.floor(10.5);
// =>
// │
// │
// │
// │
// │
// |_____10.5_____
Math.ceil(10.5);
// =>
// _____10.5_____
// |
// │
// │
// │
// │
// │
Math.round(10.5);
// => x x x x x
// x x x x
// x x
// x x
// x x
// x x
// x x
// x 1 0 . 5 x
// x x
// x x
// x x
// x x
// x x
// x x x x
// x x x x x
Math.pow(10.5);
// => ,--.--._
// ------" _, \___)
// POW! / _/____) ( 10.5 )
// \//(____)
// ------\ (__)
// `-----"
Math.random();
// => 7
Math.abs(0);
// => ,▄▓▓▓▓▓▓▓▓▓▓▓▓▒░░╬Θ░⌂ ░░░░-
// ,▄▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌╣╣░░░░⌂ ░░░░░░░░░░░░░⌐
// ╓▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒╣░░░░░░ ░░░░░░░⌂ '░░░
// ,▄▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌╬░░░░░░░░░░░░░░░░⌐ ⌂⌂░░░⌐
// ,╗▒▓▌▒▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▌╬╢▀╣╣░░░░░░░░░░⌂⌂░░░░░░⌂░⌂░░░░░╖
// ,▒▓▓▒╣╬╬╬╬╬╢▒▓▓▓▓▓▓▓▓▌▒▒╬░░╬╬░░░░░░░░░░░⌂ ⌂░░░░░░░░░░░░░░
// ╓▓▓▓▌▒╣╣╬╣╬╬╢▒▒▒▒▒▒▒▒▒▒╣╬░░░╬╬░░░░░░░░░░░░⌂░░░░░░░░░░░░░░░╢
// ╓▓▓▓▓▓▌▒▒╣╣╢╢╢╣╣╣╣╣╣╣╣╣╬╬╬░░░╬╢╣╣░░░░░░░░░░░░░░░░╣▒▒▒╣╬╬░░░╣╖
// ▓▓▓▓▓▓▓▌▒▒▒▒╣▒╣╣╣╣╣╬╬╬╬╬╬░░░░░╢╬╣░░░░░░░░░░░░░░░░╠▓▀δδ░░░╬╣░░╢
// ▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒╣╣╣╬╬╬╬╬░░░░░░░╢╣╬░░░░░░░░░░░░░░░╬▓▓▒▒░░░░░░░░░░⌐
// ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌▒▒╣╣╬╣╬░░░░░░░░╫▓▒▒╣╬░░░░░░░░░░╬▒▒▓▓▓▌▒╣░░░░░░░░░╕
// ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒╣╣╣╬╣╬░░░░░╬╫▓▓▓▌▒╣╣╣░░░░░╬▒▒▒╬╬▓▓▓▓▒╣░░░░░░░░░
// ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒▒▒╣▒▒▒▒▒▒▓▓▓▓▓▓▓▌▒▒▒▒▒▒▓▌▒╬╣▒▒▀╙█▓▒▒╬░░░░░░░╣
// ]▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▀δδ▀▓▓▓▓▓▓▓▓█▓▌▀▒░░╬╬╢▀ ▀▓▌▒╣╣╬░░░░░╕
// ▓▓▓▓▓▓▓▓▓▓▓▓▓█▓▓▓▓▓▓▓▓▓▓▓▓▓▌╬░░░░░▒▌▒╬╬░░╬╢╬╬░░░░╬╬▒ Σ▓▓▓▒╣▒╣░░░╣
// ▓▓▓▓▓▓▓▓▓▓▓▓▌ ╙█▓▓▓▓▓▓▓▓▓▓▌▒▒▒╣╣╢╣▒▓▓▒▒╣╬╬░░░░░░░░╣⌐ █▓▓▓▓▒╬░░░╬
// ▓▓▓▓▓▓▓▓▓▓▓▓ █▓▓▓▓▌▒╣▒╬╬╬╬░░░╬╢╫▌╣░░░░░░░░░░░░╬ ╙▓▓▓▌╬░░░░╢
// ▓▓▓▓▓▓▓▓▓▓▓Γ ╘▓▓▓▓▓▓▓▒▒╣╣╬░░░░░║▓▒╬░░░╬╣╢╣╣╬╬╬╢ ╟▓▓▌╬░░░░░╕
// ╓▓▓▓▓▓▓▓▓▓▓▀ ▓▓▓▓▓▓▓▓▓▌▒▒▒▒╣╣░╣▓▓▒▒▒╣▒▒╬╬δ▒╣╬╣ ╙▓▓▒╣╬░░░╬╢
// ▓▓▓▓▓▓▓▓▓▓▌ ▓▓▓▓█▓▓▓▀██▀╣░░░░╬╣╬░░░░░░╬░░░░╣▒ ▓▓▒╣╬░░░░╬Q
// ▓▓▓▓▌▓▓▓▓▓▓ ▓▓▌▒╬╠▓▓▒▒╣╬╬░░░╬╢▌▒╣░░░╬╬╬░░░░░╣ ║▓▓╣╬░░░░╬▒
// ]▓▓▓▒╣╢▒▓▓▓▌ ╫▓▓▒╣╬╬█▓▓▓▒╣╬╬╬░░▒▌▒╬╬╬╣╢╬░░░░░░░╦ ▓▓▌╣╬░░░╬▒
// ╟▓▓▌▒╣╣╢╣╣▒▌ ▓▓▓▒╣╣╬╢▒▒▒╬╬╬░░╠▒╣▀▒╬╬╣╬░░░░░░░░░╣ └▓▓▒╬╬░░╬╢
// ╟▓▓▓▒╣╣╣╣▒▒Θ ▓▓▓▌▒╣╬╬▒▌▒╣╣╣╬░░░╬╬░░░░░░░░░░░░░╬▒ ╚▓▌╣╬░░╬╢
// ▓▓▓▓▌▒╣╢╣╣▒⌐ ]▓▓▓▓▓▒╣╬╬▒▒▒╣╣╣╢╬╣╣╣╣╬╬╬╬░░░░░░╬╢╣▒ ▀▓▒╬░░╬╢
// ▓▓▓▓▌▒╣╣▒▒▌ ╒▓▓▓▓▓▓▓▌▒╬╢▒▒▒╣╣╣╬╬╢╣╣╣╬╣╬░▄▄▄▄▓▓▓▓▓▓▌ ▓▌╬░░╬╢
// ╟▓▓▓▓▒▒▒▒▓▒ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▐▓▒░░╢╬
right-pad is licensed under the MIT license. See LICENSE
for the
full text.
This was a late night, sleep deprived idea of Michael Hulet