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

Logic Issue When Using String Interpolation #164

Open
helenelach opened this issue Dec 4, 2024 · 2 comments
Open

Logic Issue When Using String Interpolation #164

helenelach opened this issue Dec 4, 2024 · 2 comments
Assignees

Comments

@helenelach
Copy link

The following code raises an "Attempted to divide by zero" error.

var value1 = 100m;
var value2 = 0m;

var value3 = value2 > 0
     ? $"{(value1 / value2):P2}"
     : "";

This, though, works:

var value1 = 100m;
var value2 = 0m;

var value3 = value2 > 0
     ? (value1 / value2).ToString("P2")
     : "";

Using version 6.2.3

@JonathanMagnan JonathanMagnan self-assigned this Dec 4, 2024
@JonathanMagnan
Copy link
Member

Hello @helenelach ,

Thank you for reporting. We will look into what can be done.

Best Regards,

Jon

@JonathanMagnan
Copy link
Member

Hello @helenelach ,

The v6.2.4 has been released.

Could you let us know if the issue has been correctly fixed? We know there are still some very advanced cases in this issue that could still apply, but almost all the most common cases should be fixed now.

Best Regards,

Jon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants