https://bugs.winehq.org/show_bug.cgi?id=55185
Bug ID: 55185 Summary: vbscript round does not handle numdecimalplaces argument Product: Wine Version: 8.11 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: vbscript Assignee: wine-bugs@winehq.org Reporter: jsm174@gmail.com Distribution: ---
We just found an issue where round wasn't returning expected values when using the `numdecimalplaces` argument.
After looking at `Global_Round`, the second argument is not even looked at.
As a test, I modified the code to use: `VarR8Round` which seems to work well:
``` int decimal_places = 0; double n; double n2; HRESULT hres; . . . if (args_cnt > 1) { if (V_VT(args+1) != VT_ERROR) { hres = to_int(args+1, &decimal_places); if (FAILED(hres)) return hres; } }
hres = VarR8Round(n, decimal_places, &n2); if(FAILED(hres)) return hres;
return return_double(res, n2); ```