mirror of https://github.com/stashapp/stash.git
Fix unit conversion rounding (#3519)
This commit is contained in:
parent
1c8aa46da5
commit
579c5ad8b9
|
@ -1,11 +1,11 @@
|
|||
export function cmToImperial(cm: number) {
|
||||
const cmInInches = 0.393700787;
|
||||
const inchesInFeet = 12;
|
||||
const inches = Math.floor(cm * cmInInches);
|
||||
const inches = Math.round(cm * cmInInches);
|
||||
const feet = Math.floor(inches / inchesInFeet);
|
||||
return [feet, inches % inchesInFeet];
|
||||
}
|
||||
|
||||
export function kgToLbs(kg: number) {
|
||||
return Math.floor(kg * 2.20462262185);
|
||||
return Math.round(kg * 2.20462262185);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue