Skip to content

Conversation

@ZhongpinWang
Copy link
Contributor

@ZhongpinWang ZhongpinWang commented Oct 28, 2025

Closes #6042.

Replace the mistakenly used value.toNumber() with Number(value) in OData V4 default de-serializers.

@deekshas8
Copy link
Contributor

deekshas8 commented Oct 29, 2025

Replace the mistakenly used value.toNumber()

I don't think this was a mistake. The expected input type for Edm.Decimal in Odata v4 is BigNumber, which has a .toNumber() function. But since both lead to precision loss, I wonder if either is even a good idea (BigNumber has functions to check if it's outside/within range).

@ZhongpinWang
Copy link
Contributor Author

Replace the mistakenly used value.toNumber()

I don't think this was a mistake. The expected input type for Edm.Decimal in Odata v4 is BigNumber, which has a .toNumber() function. But since both lead to precision loss, I wonder if either is even a good idea (BigNumber has functions to check if it's outside/within range).

Make sense. I didn't consider this. Then the question is why user received a string in the Decimal field right?

@ZhongpinWang ZhongpinWang added the don't merge Don't merge label Nov 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

don't merge Don't merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OData V4 deserialize error for decimal fields if we pass decimal value in "" as string

3 participants