question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Expression] inconsistency between doc and implementation for 'int', 'float'

See original GitHub issue

Github issues should be used for bugs and feature requests. Use Stack Overflow for general “how-to” questions.

Version

What package version of the SDK are you using.

Current main

Describe the bug

Give a clear and concise description of what the bug is.

The document says ‘Return the floating point representation of the specified string or the string itself if conversion isn’t possible.’

https://docs.microsoft.com/en-us/azure/bot-service/adaptive-expressions/adaptive-expressions-prebuilt-functions?view=azure-bot-service-4.0#conversion-functions

However, if one uses int('bad'), float('bad'), it will throw an exception ‘Input string was not in a correct format.’

To Reproduce

Steps to reproduce the behavior:

  1. See https://github.com/xieofxie/botbuilder-dotnet/commit/5084688a55c11b3749a85dbae9ca426bd33a14be

Expected behavior

Give a clear and concise description of what you expected to happen.

If exception is the planned behavior, we still need a function to know if a string is whether in int format (from document, we could int and then isInteger

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
xieofxiecommented, Oct 9, 2020

@emgrol Sure, hope the new functions could be added soon.

0reactions
Danieladucommented, Oct 9, 2020

close this one due to the duplication of #4773

Read more comments on GitHub >

github_iconTop Results From Across the Web

int is not a Number? · Issue #3186 · python/mypy
I've been trying to cobble together a library that interoperates between a number of domains (e.g. floats, Fraction, Decimal, numpy, gmp, sympy, ...
Read more >
What Every Computer Scientist Should Know About ...
Almost every language has a floating-point datatype; computers from PCs to supercomputers have floating-point accelerators; most compilers will be called upon ...
Read more >
What are the implications of constexpr floating-point math?
This can lead to possible inconsistencies in the results, both between compilers, and between runtime/compile-time evaluation by the same ...
Read more >
FLP07-C. Cast the return value of a function ...
If a return statement with an expression is executed, the value of the expression is returned to the caller as the value of...
Read more >
A Tutorial on Data Representation - Integers, Floating-point ...
It is important to take note that integers and floating-point numbers are treated differently in computers. They have different representation and are ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found