We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Arma 3 Version: 1.62 (stable) CBA Version: 3.0.0 (stable)
1.62
3.0.0
Mods:
@CBA_A3
Description: With some inputs CBA_fnc_formatNumber will not behave as expected.
Steps to reproduce: In debug console variable watch put -> [65.200, 2, 3] call CBA_fnc_formatNumber
[65.200, 2, 3] call CBA_fnc_formatNumber
Observed result: "65.299"
"65.299"
Expected result: "65.200"
"65.200"
The text was updated successfully, but these errors were encountered:
Joys of floating points
(65.2 * 10^2) % 10 = 9.99951 (65.2 * 100) % 10 = 9.99951 (65.2 * 10 * 10) % 1 = 0
Sorry, something went wrong.
https://www.youtube.com/watch?v=PZRI1IfStY0 if you want to know why this happend :)
Probably best to avoid floating points whenever you can.
Question is: can we improve CBA_fnc_formatNumber to be as precise as possible with all SQF tricks or is it already as good as it gets?
CBA_fnc_formatNumber
No branches or pull requests
Arma 3 Version:
1.62
(stable)CBA Version:
3.0.0
(stable)Mods:
@CBA_A3
Description:
With some inputs CBA_fnc_formatNumber will not behave as expected.
Steps to reproduce:
In debug console variable watch put ->
[65.200, 2, 3] call CBA_fnc_formatNumber
Observed result:
"65.299"
Expected result:
"65.200"
The text was updated successfully, but these errors were encountered: