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

Add decimal conversion for DECIMAL #719

Closed
JeremyKuhne opened this issue Oct 12, 2022 · 2 comments · Fixed by #727
Closed

Add decimal conversion for DECIMAL #719

JeremyKuhne opened this issue Oct 12, 2022 · 2 comments · Fixed by #727
Assignees
Labels
enhancement New feature or request partner

Comments

@JeremyKuhne
Copy link
Member

Something like this at least and/or conversion operators would be very useful.

public decimal ToDecimal()
{
    return new decimal(
        (int)Anonymous2.Anonymous.Lo32,
        (int)Anonymous2.Anonymous.Mid32,
        (int)Hi32,
        Anonymous1.Anonymous.sign == 0x80,
        Anonymous1.Anonymous.scale);
}
@JeremyKuhne JeremyKuhne added the enhancement New feature or request label Oct 12, 2022
@AArnott
Copy link
Member

AArnott commented Oct 13, 2022

I agree. I'm guessing the snippet you whipped up is too simple to be generally accurate. Is that right? You're only using one field in union structs, which seems likely to be leaving out certain ranges.

@AArnott
Copy link
Member

AArnott commented Oct 13, 2022

Never mind. I guess those unions aren't to support different modes, but rather just to provide different cuts into the same data.

@AArnott AArnott self-assigned this Oct 13, 2022
AArnott added a commit that referenced this issue Oct 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request partner
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants