Closes #21795: Improve humanize_speed formatting for decimal Gbps/Tbps values #7

Closed
opened 2026-04-05 16:21:11 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @pheus on 4/3/2026

Fixes: #21795

This updates the humanize_speed template filter to always display speeds using the largest appropriate unit, including decimal values where needed. For example, 2500000 Kbps now renders as 2.5 Gbps instead of 2500 Mbps, and 1600000000 Kbps renders as 1.6 Tbps instead of 1600 Gbps.

This brings the filter in line with the speed notation already used elsewhere in NetBox and adds test coverage for whole-number and fractional values across Mbps, Gbps, and Tbps.

*Originally created by @pheus on 4/3/2026* ### Fixes: #21795 This updates the `humanize_speed` template filter to always display speeds using the largest appropriate unit, including decimal values where needed. For example, `2500000` Kbps now renders as `2.5 Gbps` instead of `2500 Mbps`, and `1600000000` Kbps renders as `1.6 Tbps` instead of `1600 Gbps`. This brings the filter in line with the speed notation already used elsewhere in NetBox and adds test coverage for whole-number and fractional values across Mbps, Gbps, and Tbps.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/netbox#7