Closes #21267: Normalize device height formatting in rack units (display 0U) #438

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

Originally created by @pheus on 1/30/2026

Fixes: #21267

This PR updates the device Dimensions panel to render rack unit height using TemplatedAttr and a dedicated template applying Django’s floatformat filter.

As a result, devices with a u_height of 0.0 now display as 0U (and whole-unit values no longer show a trailing .0), matching the expected rack-unit presentation and avoiding ambiguity for users.

Thanks for the review!

*Originally created by @pheus on 1/30/2026* ### Fixes: #21267 This PR updates the device **Dimensions** panel to render rack unit height using `TemplatedAttr` and a dedicated template applying Django’s `floatformat` filter. As a result, devices with a `u_height` of `0.0` now display as **`0U`** (and whole-unit values no longer show a trailing `.0`), matching the expected rack-unit presentation and avoiding ambiguity for users. Thanks for the review!
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/netbox#438