Skip to content

Commit

Permalink
#3 | pass precision as parameter in calculateBMI function
Browse files Browse the repository at this point in the history
  • Loading branch information
sachsk committed May 16, 2024
1 parent 5328e94 commit 40f4749
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/health_modules/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ function C() {
)
};

this.calculateBMI = function (weight, height) {
return _.ceil((weight / Math.pow(height, 2)) * 10000, 1);
this.calculateBMI = function (weight, height, precision = 1) {
return _.ceil((weight / Math.pow(height, 2)) * 10000, precision);
};
this.calculateGrowthStatusForAdolescent = function ({individual, weight, asOnDate}) {
return calculateGrowthStatus(individual,weight,asOnDate)
Expand Down

0 comments on commit 40f4749

Please sign in to comment.