import { roundHalfUp } from "@/lib/math"; const KG_TO_LB = 2.20462; const CM_TO_IN = 2.54; /** kg → lb,ROUND_HALF_UP 保留 2 位(GD-13) */ export function kgToLb(kg: number): number { return roundHalfUp(kg * KG_TO_LB, 2); } /** cm → in,ROUND_HALF_UP 保留 2 位(GD-13,内部哈希/展示用) */ export function cmToIn(cm: number): number { return roundHalfUp(cm / CM_TO_IN, 2); } /** MotherShip axel/quote 与 RPA 表单要求英寸为正整数(向上取整) */ export function toAxelWholeInches(inches: number): number { return Math.max(1, Math.ceil(inches - Number.EPSILON)); } /** MotherShip axel/quote 要求磅为正整数(向上取整) */ export function toAxelWholePounds(lb: number): number { return Math.max(1, Math.ceil(lb - Number.EPSILON)); }