mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-14 01:41:22 -06:00
Fixes #12779: Correct arithmetic for converting inches to meters
This commit is contained in:
parent
9f70407c7d
commit
dee4aec62d
@ -25,6 +25,7 @@
|
||||
* [#12742](https://github.com/netbox-community/netbox/issues/12742) - Object counts dashboard widget should support URL-compatible query filters
|
||||
* [#12762](https://github.com/netbox-community/netbox/issues/12762) - Fix GraphiQL UI by reverting graphene-django to earlier version
|
||||
* [#12745](https://github.com/netbox-community/netbox/issues/12745) - Escape display text in API-backed selection widgets
|
||||
* [#12779](https://github.com/netbox-community/netbox/issues/12779) - Correct arithmetic for converting inches to meters
|
||||
|
||||
---
|
||||
|
||||
|
@ -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'.")
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user