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

Support for non-int time ranges in timex in c# #3106

Open
sibbl opened this issue May 19, 2023 · 1 comment
Open

Support for non-int time ranges in timex in c# #3106

sibbl opened this issue May 19, 2023 · 1 comment

Comments

@sibbl
Copy link

sibbl commented May 19, 2023

Describe the bug
From LUIS, I get a Timex valued PT0.5H. I'd like to parse the string with this library, but the parts (i.e. hours) must be an int. See code.

To Reproduce
Steps to reproduce the behavior:

  1. Parse a Timex from the string PT0.5H via TimexResolver.Resolve(new[] { "PT0.5H });
  2. A ThrowOverflowOrFormatException is thrown.

Expected behavior
The timex is parsed properly.

Platform (please complete the following information):

  • Platform: C#
  • Environment: nuget package
  • Version of package: 1.8.8
@sibbl
Copy link
Author

sibbl commented May 19, 2023

Could decimal.Parse straight into the decimal Hours variable already solve it perhaps?

sibbl pushed a commit to sibbl/Recognizers-Text that referenced this issue May 19, 2023
sibbl pushed a commit to sibbl/Recognizers-Text that referenced this issue May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant