Allow for at Least One Decimal in Cable Lengths #4760

Closed
opened 2025-12-29 19:20:11 +01:00 by adam · 5 comments
Owner

Originally created by @jdavidson2021 on GitHub (Apr 14, 2021).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v2.10.4

Feature type

Change to existing functionality

Proposed functionality

Currently Netbox only supports whole numbers for cable lengths. I propose that that the user be able to enter cable lengths with at least one decimal point.

Use case

Most fibers are measured in meters and we use fiber cables in .2 and .5 meter increments for in-rack cables from the servers to the top of rack switches. I would like to be able to use Netbox to develop a cable running list and potentially a cabling bill of materials. This would mean that the cable lengths need to match what needs to be ordered as well as what needs to be installed. Currently I have to round our cable lengths to the nearest whole number to add them to import them into the database, or leave the length off of the cable which is sub-optimal with how I would like to be able to use the tool.

Database changes

Cable length field would need to allow for one decimal place.

External dependencies

No response

Originally created by @jdavidson2021 on GitHub (Apr 14, 2021). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v2.10.4 ### Feature type Change to existing functionality ### Proposed functionality Currently Netbox only supports whole numbers for cable lengths. I propose that that the user be able to enter cable lengths with at least one decimal point. ### Use case Most fibers are measured in meters and we use fiber cables in .2 and .5 meter increments for in-rack cables from the servers to the top of rack switches. I would like to be able to use Netbox to develop a cable running list and potentially a cabling bill of materials. This would mean that the cable lengths need to match what needs to be ordered as well as what needs to be installed. Currently I have to round our cable lengths to the nearest whole number to add them to import them into the database, or leave the length off of the cable which is sub-optimal with how I would like to be able to use the tool. ### Database changes Cable length field would need to allow for one decimal place. ### External dependencies _No response_
adam added the status: acceptedtype: feature labels 2025-12-29 19:20:11 +01:00
adam closed this issue 2025-12-29 19:20:11 +01:00
Author
Owner

@TheNetworkGuy commented on GitHub (Apr 14, 2021):

For your script: wouldn't multiplying your length *100 and setting the value in Netbox from meters to centimetres solve your issue?

Instead of 2,5 meters you would have 250 CM's.

@TheNetworkGuy commented on GitHub (Apr 14, 2021): For your script: wouldn't multiplying your length *100 and setting the value in Netbox from meters to centimetres solve your issue? Instead of 2,5 meters you would have 250 CM's.
Author
Owner

@jbakklund commented on GitHub (Apr 14, 2021):

The database already store _abs_length as a numeric (10,4) but the user is still limited to input length quantity as a smallint. Being used to SI-units, it feels awkward being limited to use centimeters for any lengths in excess of one meter, as long as the requirement for accuracy is within the range of one or two decimals, which is usually the case for a cable length.

This means that a cable being specified to have a length of 6 feet, is listed in the database with _abs_length equal to '1.8288', so it should be feasible to allow users to input fractions of a meter using decimals. Even better; it should be possible to convert length automagically if length_unit is being changed while _abs_length is not.

E.g.: If length is still '6' and unit is being changed from 'Feet' to 'Meters', length should be displayed as '1.8 m' and not '6 m'.

@jbakklund commented on GitHub (Apr 14, 2021): The database already store __abs_length_ as a numeric (10,4) but the user is still limited to input _length_ quantity as a smallint. Being used to SI-units, it feels awkward being limited to use centimeters for any lengths in excess of one meter, as long as the requirement for accuracy is within the range of one or two decimals, which is usually the case for a cable length. This means that a cable being specified to have a length of 6 feet, is listed in the database with __abs_length_ equal to '1.8288', so it should be feasible to allow users to input fractions of a meter using decimals. Even better; it should be possible to convert _length_ automagically if _length_unit_ is being changed while __abs_length_ is not. E.g.: If length is still '6' and unit is being changed from 'Feet' to 'Meters', length should be displayed as '1.8 m' and not '6 m'.
Author
Owner

@jdavidson2021 commented on GitHub (Apr 14, 2021):

@TheNetworkGuy I wouldn't say that entering the data into Netbox in centimeters instead of meters solves my issue, but it could be a work around. I would prefer to enter the data into Netbox the same way the cable is ordered or listed on a bill of materials or listed in the cable running list and also labeled on the cable itself. We have multiple users of the data in Netbox and it needs to be as clear as possible so that we don't cause confusion in the ordering process or in the installation process. I do like the conversion capability mentioned by @jbakklund.

@jdavidson2021 commented on GitHub (Apr 14, 2021): @TheNetworkGuy I wouldn't say that entering the data into Netbox in centimeters instead of meters solves my issue, but it could be a work around. I would prefer to enter the data into Netbox the same way the cable is ordered or listed on a bill of materials or listed in the cable running list and also labeled on the cable itself. We have multiple users of the data in Netbox and it needs to be as clear as possible so that we don't cause confusion in the ordering process or in the installation process. I do like the conversion capability mentioned by @jbakklund.
Author
Owner

@jeremystretch commented on GitHub (May 4, 2021):

I think this makes sense to implement, however I'm marking it as blocked until we figure out how decimal fields should be represented in the REST API (see #6338).

@jeremystretch commented on GitHub (May 4, 2021): I think this makes sense to implement, however I'm marking it as blocked until we figure out how decimal fields should be represented in the REST API (see #6338).
Author
Owner

@jeremystretch commented on GitHub (May 4, 2021):

Related to #5806

@jeremystretch commented on GitHub (May 4, 2021): Related to #5806
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4760