-
Notifications
You must be signed in to change notification settings - Fork 161
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
get_float does not work correctly #420
Comments
With a fix the asserts in the added test can be enabled Lines 36 to 51 in 6cefcb1
|
I will look into that tomorrow, Thank you for the report @ttytm. |
I can't reproduce the issue. Probably we may need the full logs to know what's going on. Also, the browser or WV you are using. |
Happens in chrome and Firefox for me. Logs `call_c_from_js` example:
|
I see it doesn't reproduces in CI (asserts for floats are currently commented out, values are only printed): JS passed: await webui.assert_float(1.0, 2.3, 3.45); backed prints:
ref. Test Static step in: webui-dev/webui/actions/runs/9541169685/job/26293993613 Looks correct on the ubuntu runner. |
The get_string call doesn't look right:
The example is unchanged ofc. |
Looks correct, the UI (bridge) sent all data. assert(num3 == 3.45f); |
I'm receiving a 00 decimal so in the test its 3.00 and the assert does not work. As the logs show, |
Yes, I want to make sure that the actual value is |
Yep the check failed, tested with atof/strtod/sscanf. Then the assert works with the fully specified number: assert(num3 == 3.450000); // true (requires setlocal on the tested machine)
assert(num3 == 3.45f); // false |
I tried to reproduce the issue, but I can't, it always works fine for me. I manually test it in:
|
Please re-open if the issue still exists. |
Bug Description
webui/examples/C/call_c_from_js/main.c
Line 35 in 9518b9e
prints:
Expected Behavior
Reproduction Steps
The
call_c_from_js
example can be used as reproductionError Logs
No response
Possible Solution
No response
Version
2.5.0-beta
Environment Details (OS name, version, etc.)
The text was updated successfully, but these errors were encountered: