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

Unexpected Float rounding #2945

Open
ibaiulnr opened this issue Jan 13, 2025 · 1 comment
Open

Unexpected Float rounding #2945

ibaiulnr opened this issue Jan 13, 2025 · 1 comment
Labels
bug Something isn't working community To tag external issues and PRs

Comments

@ibaiulnr
Copy link

Description
When recording a CustomEvent containing a single decimal float value, the agent reports a different value.

Value set: 0.2f
Value reported: 0.20000000298023224

Expected Behavior
The agent reports exactly the value that it was initially set: 0.2

Troubleshooting or NR Diag results

Audit logs:

2025-01-13 17:20:54,086 NewRelic Audit: Data Sent from the InstrumentedApp : ["xyz",[[{"timestamp":0,"type":"TestEvent"},{"attr1":"value1","attr2":1,"attr3":0.20000000298023224,"attr4":true},{}]]]

Steps to Reproduce

Snippet used to record the event

var eventAttributes = new Dictionary<string, object> {
                {"attr1", "value1"},
                {"attr2", 1},
                {"attr3", 0.2f},
                {"attr4", true}
            };
NewRelic.Api.Agent.NewRelic.RecordCustomEvent("TestEvent", eventAttributes);

Your Environment
Agent version: 10.34.1
.NET version: 8.0
OS: 24.04.1 LTS
Base docker image: mcr.microsoft.com/dotnet/sdk:8.0-noble

@ibaiulnr ibaiulnr added the bug Something isn't working label Jan 13, 2025
@workato-integration
Copy link

@github-actions github-actions bot added the community To tag external issues and PRs label Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working community To tag external issues and PRs
Projects
None yet
Development

No branches or pull requests

1 participant