Skip to content

An library with some functions relates to Body Mass Index (BMI), like calculate and get the ideial weight

License

Notifications You must be signed in to change notification settings

emanuelgsouza/bmi-utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

body-mass-index

A Javascript lib to calculate body mass index.

Install

yarn add body-mass-index

Usage

import { calculate } from 'body-mass-index'

// ... 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:

calculate(65, 1.7) // returns '22.49'

ideialWeight(height, genre)

This function receives height (Number) and genre (String) and return a object with min and max ideal weight.

ideialWeight(1.70, 'M') // 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.

loadCategory('M', 26.39) // returns Normal weight

Author

Emanuel Gonçalves

About

An library with some functions relates to Body Mass Index (BMI), like calculate and get the ideial weight

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published