bmi-utils
A Javascript lib to calculate body mass index.
Install
yarn add bmi-utils
Usage
// ... your code here
Library functions
This lib exports the following functions:
calculate(weight, heigth)
This function receives weight
(Number) and heigth
(Number) and return a BMI calculated. Examples:
// returns '22.49'
ideialWeight(height, genre)
This function receives height
(Number) and genre
(String) and return a object with min
and max
ideal weight.
// returns { min: '59.82', max: '76.27' }
loadCategory(genre, imc, translation)
This function receives genre
(String), imc
(Number), and translation
(String - optional) properties and return a string with categorization of BMI.
// returns Normal weight
Author
Emanuel Gonçalves
- Twitter @emanuelgsouza
- Github @emanuelgsouza