fpspreadsheet: Fix formula ROUND() if second argument is a cell reference.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6533 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2018-06-26 14:21:45 +00:00
parent c721b9d5a4
commit d6b6154fff

View File

@ -309,13 +309,13 @@ end;
procedure fpsROUND(var Result: TsExpressionResult; const Args: TsExprParameterArray);
var
x: Double;
n: Integer;
begin
if Args[1].ResultType = rtInteger then
n := Args[1].ResInteger
else
n := round(Args[1].ResFloat);
Result := FloatResult(RoundTo(ArgToFloat(Args[0]), -n));
x := ArgToFloat(Args[0]);
n := Round(ArgToFloat(Args[1]));
Result := FloatResult(RoundTo(x, -n));
// -n because fpc and Excel have different conventions regarding the sign
end;
procedure fpsSIGN(var Result: TsExpressionResult; const Args: TsExprParameterArray);