You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
format_compound_unit adds an extra unit to preformatted string numerators #1398
On unchanged upstream e2a1791, format_compound_unit("1 kg", "kilometer", denominator_unit="hour", locale="en") returns "1 kg kilometer per hour"; calling the same function without numerator_unit returns "1 kg per hour". The documented contract says a string value is preformatted and its corresponding unit argument is ignored. The compound-unit optimization bypasses that rule for denominator_value == 1 and a known compound unit. This affects callers that accept either numeric quantities or already-localized display strings while retaining unit metadata. Eighteen regression cases across en/fi/fr and long/short/narrow lengths reproduce the mismatch before a production-code change. The numeric fast path should remain intact, but preformatted strings should use the existing general path. Identified and tested with AI assistance; no personal review or provenance attestation by the account owner is asserted.
Activity