1
0
Fork 0

feat: Changes to utils for new measurement icons

This commit is contained in:
Joost De Cock 2021-05-30 18:27:53 +02:00
parent 5e48846884
commit bb64eebd7c
4 changed files with 20 additions and 14 deletions

View file

@ -8,10 +8,14 @@ const measurementDiffers = (
neckCircumference,
measurementName,
measurementValue,
breasts = false
) =>
Math.abs(
Math.round((measurementValue - neckstimate(neckCircumference, measurementName, breasts)) / 20)
)
breasts = false,
absolute = true
) => {
let result = Math.round((measurementValue - neckstimate(neckCircumference, measurementName, breasts)) / 20)
return absolute
? Math.abs(Math.round((measurementValue - neckstimate(neckCircumference, measurementName, breasts)) / 20))
: (measurementValue - neckstimate(neckCircumference, measurementName, breasts, true)) / 20
}
export default measurementDiffers