Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Custom attribute values of type float and decimal were not serialized correctly. #2975

Merged
merged 1 commit into from
Jan 30, 2025

Conversation

tippmar-nr
Copy link
Member

@tippmar-nr tippmar-nr commented Jan 30, 2025

Custom attribute values of type float or decimal could, in some cases, be serialized with a different precision than the original value (i.e., 0.2f would be serialized as 0.20000000298023224) due to a conversion to double prior to serialization.

Adds unit tests to verify correct behavior.

fixes #2945

@tippmar-nr tippmar-nr requested a review from a team as a code owner January 30, 2025 19:10
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.15%. Comparing base (b141eee) to head (fa079bd).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2975      +/-   ##
==========================================
- Coverage   82.16%   82.15%   -0.01%     
==========================================
  Files         473      473              
  Lines       30334    30335       +1     
  Branches     3387     3387              
==========================================
- Hits        24923    24921       -2     
- Misses       4612     4617       +5     
+ Partials      799      797       -2     
Flag Coverage Δ
Agent 83.13% <100.00%> (-0.02%) ⬇️
Profiler 73.13% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...Relic/Agent/Core/Attributes/AttributeDefinition.cs 84.22% <100.00%> (+0.05%) ⬆️

... and 4 files with indirect coverage changes

@tippmar-nr tippmar-nr merged commit 8812fe1 into main Jan 30, 2025
97 checks passed
@tippmar-nr tippmar-nr deleted the fix/custom-attribute-rounding branch January 30, 2025 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unexpected Float rounding
3 participants