mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Fixes #12779: Correct arithmetic for converting inches to meters
This commit is contained in:
@ -302,7 +302,7 @@ def to_meters(length, unit):
|
||||
if unit == CableLengthUnitChoices.UNIT_FOOT:
|
||||
return length * Decimal(0.3048)
|
||||
if unit == CableLengthUnitChoices.UNIT_INCH:
|
||||
return length * Decimal(0.3048) * 12
|
||||
return length * Decimal(0.0254)
|
||||
raise ValueError(f"Unknown unit {unit}. Must be 'km', 'm', 'cm', 'mi', 'ft', or 'in'.")
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user