Skip to content

Add trillion unit, fix negatives, show decimals#5

Merged
lupodevelop merged 1 commit into
mainfrom
v1.2.0/fix-and-feature
Mar 24, 2026
Merged

Add trillion unit, fix negatives, show decimals#5
lupodevelop merged 1 commit into
mainfrom
v1.2.0/fix-and-feature

Conversation

@lupodevelop

Copy link
Copy Markdown
Owner

Bump version to 1.2.0 and introduce several formatting fixes and features: add support for the T (trillion) suffix in number/number_with (including rounding-promotion from B → T), make bytes_decimal/bytes_binary always show a decimal when the value is scaled to a sub-unit (KB and above) while keeping raw bytes without decimals, and handle negative seconds correctly in duration and duration_precise by formatting the absolute value and prepending a leading "-". Defensive guards were added to pow10_acc and pow_int_acc to return 1 for non‑positive exponents to prevent infinite recursion when decimals <= 0. Tests and humanize.toml were updated to reflect the new behavior and edge cases (negative durations, trillion numbers, and safe handling of non‑positive decimals).

Bump version to 1.2.0 and introduce several formatting fixes and features: add support for the T (trillion) suffix in number/number_with (including rounding-promotion from B → T), make bytes_decimal/bytes_binary always show a decimal when the value is scaled to a sub-unit (KB and above) while keeping raw bytes without decimals, and handle negative seconds correctly in duration and duration_precise by formatting the absolute value and prepending a leading "-". Defensive guards were added to pow10_acc and pow_int_acc to return 1 for non‑positive exponents to prevent infinite recursion when decimals <= 0. Tests and humanize.toml were updated to reflect the new behavior and edge cases (negative durations, trillion numbers, and safe handling of non‑positive decimals).
@lupodevelop lupodevelop merged commit 02c520b into main Mar 24, 2026
1 check passed
@lupodevelop lupodevelop deleted the v1.2.0/fix-and-feature branch March 24, 2026 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant