Skip to content

Add an overide for the increment function to allow user to specify siginificant digits #7736

Open
@switch201

Description

@switch201

New Feature / Enhancement Checklist

Current Limitation

When using the parseObj.increment function, there is no way to account for floating point arithmatic errors. For example, if in the database I have a Quantity Column, and it has a value of 6.5 and I want to call `someObj.increment("Quantity", -4.1) instead of 2.4 being saved to that column 2.4000000000000004 is saved instead. From what I can tell there is no way to use the increment function and have it account for this. you have to do the math yourself and use set, which is not an option for us in thie case

Feature / Enhancement Description

make an override to the increment function that takes an additional parameter specifying the number of significant digits

Example Use Case

if in the database I have a Quantity Column, and it has a value of 6.5 and I want to call `someObj.increment("Quantity", -4.1) instead of 2.4 being saved to that column 2.4000000000000004 is saved instead. From what I can tell there is no way to use the increment function and have it account for this. you have to do the math yourself and use set, which is not an option for us in thie case

Alternatives / Workarounds

Using Set and the save would work, but given this column sees alot of traffic at once, it raises concerns of a race condition happening which can lead to an inacurate count which is why we use the increment function rather than set and save.

3rd Party References

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:questionSupport or code-level question

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions