You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
382 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import { roundHalfUp } from "@/lib/math";
const KG_TO_LB = 2.20462;
const CM_TO_IN = 2.54;
/** kg → lbROUND_HALF_UP 保留 2 位GD-13 */
export function kgToLb(kg: number): number {
return roundHalfUp(kg * KG_TO_LB, 2);
}
/** cm → inROUND_HALF_UP 保留 2 位GD-13 */
export function cmToIn(cm: number): number {
return roundHalfUp(cm / CM_TO_IN, 2);
}