[PR #18883] [MERGED] Fixes #18869: Ensure to_meters() always returns a clean decimal value #15462

Closed
opened 2025-12-30 00:22:04 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/18883
Author: @jeremystretch
Created: 3/12/2025
Status: Merged
Merged: 3/12/2025
Merged by: @jnovinger

Base: mainHead: 18869-conversion-utilities


📝 Commits (2)

  • 486d2bb Fixes #18869: Ensure to_meters() always returns a clean decimal value
  • f6ebd02 Handle float values

📊 Changes

2 files changed (+66 additions, -12 deletions)

View changed files

📝 netbox/utilities/conversion.py (+13 -12)
netbox/utilities/tests/test_conversions.py (+53 -0)

📄 Description

Fixes: #18869

  • Ensure to_meters() always returns a decimal value rounded to four decimal places
  • Add tests for to_meters() & to_grams()

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/18883 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 3/12/2025 **Status:** ✅ Merged **Merged:** 3/12/2025 **Merged by:** [@jnovinger](https://github.com/jnovinger) **Base:** `main` ← **Head:** `18869-conversion-utilities` --- ### 📝 Commits (2) - [`486d2bb`](https://github.com/netbox-community/netbox/commit/486d2bb51b3ef9f4d9f8f4fa40a5e0e652525b33) Fixes #18869: Ensure to_meters() always returns a clean decimal value - [`f6ebd02`](https://github.com/netbox-community/netbox/commit/f6ebd0240e96de7a56f898f30521a1450f900c24) Handle float values ### 📊 Changes **2 files changed** (+66 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `netbox/utilities/conversion.py` (+13 -12) ➕ `netbox/utilities/tests/test_conversions.py` (+53 -0) </details> ### 📄 Description ### Fixes: #18869 - Ensure `to_meters()` always returns a decimal value rounded to four decimal places - Add tests for `to_meters()` & `to_grams()` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-30 00:22:04 +01:00
adam closed this issue 2025-12-30 00:22:04 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15462