Add user preference for metric or imperial measurements. #10073

Open
opened 2025-12-29 21:26:32 +01:00 by adam · 3 comments
Owner

Originally created by @ghost on GitHub (Aug 10, 2024).

NetBox version

v.4.0.8

Feature type

New functionality

Proposed functionality

Hot on the heels of https://github.com/netbox-community/netbox/issues/17126, it got me thinking. It would be great for users to be able to see weight units according to regional expectations.

Use case

For global companies, you might have a user (in the US) create a device type using the weight unit 'pounds' because in the United States that is the generally accepted weight measurement.
But we must acknowledge that 99% of the rest of the world uses the metric system.
Fixing https://github.com/netbox-community/netbox/issues/17126 would make the device follow the same weight unit as the device type, but it would be nice if users had a choice in how the weight unit is rendered based on their preference.

How this might be implemented would be:
User Preferences -> Preferences -> User Interface -> create a new dropdown option named "Unit Measurement"
The available options in this dropdown would be:
Inherit (default option)
Metric
Imperial

This way, you provide maximum flexibility. The default option would be to match whatever the upstream device type weight measurement unit is.
But a user could override that by selecting either Metric or Imperial. Then NetBox would convert the weight during the page render. (which appears what its already doing. See https://github.com/netbox-community/netbox/issues/17126 for existing behavior.

Database changes

Additional key for storing the new user preference.

External dependencies

none.

Originally created by @ghost on GitHub (Aug 10, 2024). ### NetBox version v.4.0.8 ### Feature type New functionality ### Proposed functionality Hot on the heels of https://github.com/netbox-community/netbox/issues/17126, it got me thinking. It would be great for users to be able to see weight units according to regional expectations. ### Use case For global companies, you might have a user (in the US) create a device type using the weight unit 'pounds' because in the United States that is the generally accepted weight measurement. But we must acknowledge that 99% of the rest of the world uses the metric system. Fixing https://github.com/netbox-community/netbox/issues/17126 would make the device follow the same weight unit as the device type, but it would be nice if users had a choice in how the weight unit is rendered based on their preference. How this might be implemented would be: User Preferences -> Preferences -> User Interface -> create a new dropdown option named "Unit Measurement" The available options in this dropdown would be: Inherit (default option) Metric Imperial This way, you provide maximum flexibility. The default option would be to match whatever the upstream device type weight measurement unit is. But a user could override that by selecting either Metric or Imperial. Then NetBox would convert the weight during the page render. (which appears what its already doing. See https://github.com/netbox-community/netbox/issues/17126 for existing behavior. ### Database changes Additional key for storing the new user preference. ### External dependencies none.
adam added the type: featurenetboxstatus: backlogcomplexity: low labels 2025-12-29 21:26:32 +01:00
Author
Owner

@jeremystretch commented on GitHub (Aug 15, 2024):

This was originally proposed in #11873 but never ended up getting implemented.

@jeremystretch commented on GitHub (Aug 15, 2024): This was originally proposed in #11873 but never ended up getting implemented.
Author
Owner

@ghost commented on GitHub (Aug 16, 2024):

https://github.com/netbox-community/netbox/issues/11873 and https://github.com/netbox-community/netbox/issues/13915
Seems it keeps coming up.

Not sure how many people leverage the 'weight' field of objects, but for those that do, it makes sense to display the weight in their localized unit.

@ghost commented on GitHub (Aug 16, 2024): https://github.com/netbox-community/netbox/issues/11873 and https://github.com/netbox-community/netbox/issues/13915 Seems it keeps coming up. Not sure how many people leverage the 'weight' field of objects, but for those that do, it makes sense to display the weight in their localized unit.
Author
Owner

@ghost commented on GitHub (Aug 19, 2024):

This measurement unit preference would also be beneficial for the recently implemented wireless distances: https://github.com/netbox-community/netbox/issues/15106

If 1 user puts the wireless distance in as 300 feet, a user in the UK could look at the link and see 100 meters.

@ghost commented on GitHub (Aug 19, 2024): This measurement unit preference would also be beneficial for the recently implemented wireless distances: https://github.com/netbox-community/netbox/issues/15106 If 1 user puts the wireless distance in as 300 feet, a user in the UK could look at the link and see 100 meters.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#10073