Skip to content

Implement Decimal and/or Float as a custom field data type #10348

Closed
@eronlloyd

Description

@eronlloyd

NetBox version

v3.3.2

Feature type

Change to existing functionality

Proposed functionality

While the Integer custom field data type is usage for many use cases, there are others that require decimal or float precision.

I propose that one or both of these numeric types be added as choices for custom fields to enable such use cases. @jeremystretch pointed out that the underlying JSON serialization would have to be taken into consideration for the different types as JSON doesn't distinguish between numerical types. This constraint may make sticking with Decimal the better option to preserve precision.

Use case

As an example, I'm trying to create custom fields for optical insertion loss (IL) for ports and attenuation for cables, but this needs to be in decimal format to accurately represent the decibel values.

Database changes

Stored as JSON in the DB, so shouldn't affect the data model. Requires changes when serialized/de-serialized into memory.

External dependencies

None

Metadata

Metadata

Assignees

Labels

status: acceptedThis issue has been accepted for implementationtype: featureIntroduction of new functionality to the application

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions