1
0
Fork 0
freesewing/packages/utils/src/measurementDiffers/index.js

18 lines
461 B
JavaScript
Raw Normal View History

import neckstimate from '../neckstimate'
// This returns how many sizes a measurement differs from the neckstimate value
2019-09-09 12:06:04 +02:00
// 0 and 2 is great
// 2 to 5 is hmmm
// and above 5 is probably wrong
const measurementDiffers = (
neckCircumference,
measurementName,
measurementValue,
breasts = false
) =>
Math.abs(
Math.round((measurementValue - neckstimate(neckCircumference, measurementName, breasts)) / 20)
)
export default measurementDiffers