From eef3c428874e91d661170b9850e85c7fb8392734 Mon Sep 17 00:00:00 2001 From: siujamo Date: Mon, 19 Jan 2026 17:42:14 +0800 Subject: [PATCH] refactor: rename BMI calculation function and update height unit comment - Renamed the function from `calculateBMI` to `calculateBodyMassIndex` for clarity. - Updated comment to change "meters" to "metres" for consistency with British English. --- src/page/bmi-calculator/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/page/bmi-calculator/index.tsx b/src/page/bmi-calculator/index.tsx index 267a00b..c897bc4 100644 --- a/src/page/bmi-calculator/index.tsx +++ b/src/page/bmi-calculator/index.tsx @@ -12,9 +12,9 @@ export default function BmiCalculator() { const [bmi, setBmi] = useState(null) const [bmiCategory, setBmiCategory] = useState("") - const calculateBMI = () => { + const calculateBodyMassIndex = () => { const weightNum = parseFloat(weight) - const heightNum = parseFloat(height) / 100 // Convert cm to meters + const heightNum = parseFloat(height) / 100 // Convert cm to metres if (weightNum > 0 && heightNum > 0) { const bmiValue = weightNum / (heightNum * heightNum) @@ -126,7 +126,7 @@ export default function BmiCalculator() { {/* Action Buttons */}