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

Implement MySqlDecimal #1070

Closed
sumitdvlp opened this issue Oct 26, 2021 · 3 comments
Closed

Implement MySqlDecimal #1070

sumitdvlp opened this issue Oct 26, 2021 · 3 comments

Comments

@sumitdvlp
Copy link
Contributor

Hi,

The GetDecimal() or GetValue() functions of MySqlDataReader class are unable to handle very large value like
'1234567890123456789012345678901234567890123456789012345678901234.5'
They throw exception like value is too large because it return C# decimal datatype.

We saw MySQL connecter net has this functionality here. which return MySqlDecimal data type.

Can you please add method like GetMySqlDecimal which can support very large Decimal values.

@bgrainger bgrainger changed the title GetDecimal() returns exception - Value is too large Implement MySqlDecimal Oct 26, 2021
@bgrainger
Copy link
Member

MySqlDecimal documentation: https://dev.mysql.com/doc/dev/connector-net/8.0/api/data_api/MySql.Data.Types.MySqlDecimal.html

The primary operations appear to be:

  • construct from a string (what validation is necessary?)
  • .Value property that converts to decimal (that might throw for large values?)
  • .ToDouble() that converts to a double (what happens if out of range?)
  • .ToString() returns the original string

@sumitdvlp
Copy link
Contributor Author

Created a PR #1075

@bgrainger
Copy link
Member

Added in 2.1.0; thanks for the PR!

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

No branches or pull requests

2 participants