From 40f4749fbc0fde4c016407d36bcb396cc8819a1b Mon Sep 17 00:00:00 2001 From: sachinkadam Date: Thu, 16 May 2024 10:59:57 +0530 Subject: [PATCH] #3 | pass precision as parameter in calculateBMI function --- src/health_modules/common.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/health_modules/common.js b/src/health_modules/common.js index f48c59c..00a3618 100644 --- a/src/health_modules/common.js +++ b/src/health_modules/common.js @@ -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)