Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@does/percent

omrilotan6.5kMIT0.0.2

Calculate one part's percentage of the whole

percent, percentage, calculate

readme

percent

A round percentage of a number from the whole

const percent = require('@does/percent');

// percent(part, whole):

percent(150, 200) // 75
percent(200, 150) // 133

Transpiled version

Environments which exclude node_modules from the transpiling pipeline should include the "browser" entry instead of "main". This exposes an ES5 commonjs module.

Also available for explicit import:

const percent = require('@does/percent/dist');