Percent2 π Percent control done right Like a percent, but 52 bytes. Inspired by @anoru advice. Install $ npm install percent2 Examples Calculate percentage import percent2 from 'percent2'; console.log(percent2(5, 20, 0)); // => 25