Several numeric columns are emitted at full float64 precision in CSV and JSON, producing noisy values like 550.09729003906 and 107.35000000000001. Markdown rounds the same fields to a sensible number of decimals, so the rounding helpers exist — they just aren't applied on the structured paths. Same family of bug as #21 but for workouts and measurements.
$ /tmp/qa-bin/withings-export workouts --since 1y --format csv | head -3
date,start,end,category,...,calories,steps,distance_m,elevation_m,...
2025-04-25,...,lift_weights,...,550.09729003906,207,157.71188354492,0,...
2025-04-25,...,bicycling,...,519.41967773438,924,703.98931884766,0,...
$ /tmp/qa-bin/withings-export workouts --since 90d --format json | jq '.[0].data'
{
"calories": 435.7490234375,
"manual_distance": 4575.8657226562,
"manual_calories": 315.9172668457,
"distance": 4162.22265625,
...
}
$ /tmp/qa-bin/withings-export measurements --since 30d --format csv | head -2
date,type,type_code,value,device_id,grp_id
2026-03-26T06:55:43-04:00,fat_free_mass_kg,5,72.84400000000001,...
$ /tmp/qa-bin/withings-export measurements --since 30d --format json | jq '.[0].value'
72.84400000000001
Severity
minor
Summary
Several numeric columns are emitted at full float64 precision in CSV and JSON, producing noisy values like
550.09729003906and107.35000000000001. Markdown rounds the same fields to a sensible number of decimals, so the rounding helpers exist — they just aren't applied on the structured paths. Same family of bug as #21 but forworkoutsandmeasurements.Reproduce
HEAD
b58068351a2edeb90f0d26b9098f04e85db225ee.Expected
calories,manual_calories: round to 1 decimal (matches the1099/806.75style thatactivity --format jsonalready uses fortotalcalories).distance,manual_distance: round to 2 decimals (matchesactivitydistance_m: 11395.42).value: round trailing-9s/trailing-1s float noise — Withings stores 3 decimal places at most for weight (107.35, not107.35000000000001);%gor%.3fwould fix it. Noteweight_kg=107.35andfat_ratio_pct=32.143already render fine — only certain unit-converted values exhibit the noise.The same
fmtRound/fmtFloat1helpers used by markdown should be applied on the CSV/JSON serializers.