bmi

package
v0.0.0-...-cebec42 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 10, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BMITooLow  = errors.New("BMI too low!")
	BMITooHigh = errors.New("BMI too high!")
)

Functions

func Calculate

func Calculate(height, weight string) (bmi float64, desc string, err error)

func CalculateWithoutStats

func CalculateWithoutStats(height, weight string) (bmi float64, desc string, err error)

func DescribeLevel

func DescribeLevel(bmi float64) (desc string)

Describe describes a calculated BMI with one of the following categories: UNDERWEIGHT, NORMAL, OVERWEIGHT, OBESE.

Types

type Counts

type Counts struct {
	Total           uint64
	Calculations    map[string]uint64
	Errors          uint64
	Average         float64
	LastCalculation string
}

Counts keep track of served calculations

func GetCounts

func GetCounts() Counts

func NewCounts

func NewCounts() Counts

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL