Skip to content

Commit

Permalink
docstring for unit_convert
Browse files Browse the repository at this point in the history
  • Loading branch information
tew49 committed Jan 10, 2025
1 parent 682479c commit eb65417
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/healthsciencecalculator/healthsciencecalculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,37 @@ def get_bmi(
- risk_level (str): Associated health risk level
"""
return

def unit_convert(value: float, input_unit: str, ouput_unit: str):
"""Converts values from one unit to another.
Supported measurement units:
- Weight: kg, g, lb, stone
- Length: m, cm, feet, inch
- Temperature: C, F, K
- Concentration: mg/dL, mmol/L
- Volume: L, mL
Parameters
----------
value : float
The numeric value to be converted.
input_unit : str
The unit of input value.
output_unit : str
The desired unit of output value.
Returns
-------
float
The output value in desired unit.
Examples
--------
>>> unit_convert(1, "m", "cm")
100
"""

0 comments on commit eb65417

Please sign in to comment.