You've already forked lazarus-ccr
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:
@@ -309,13 +309,13 @@ end;
|
|||||||
|
|
||||||
procedure fpsROUND(var Result: TsExpressionResult; const Args: TsExprParameterArray);
|
procedure fpsROUND(var Result: TsExpressionResult; const Args: TsExprParameterArray);
|
||||||
var
|
var
|
||||||
|
x: Double;
|
||||||
n: Integer;
|
n: Integer;
|
||||||
begin
|
begin
|
||||||
if Args[1].ResultType = rtInteger then
|
x := ArgToFloat(Args[0]);
|
||||||
n := Args[1].ResInteger
|
n := Round(ArgToFloat(Args[1]));
|
||||||
else
|
Result := FloatResult(RoundTo(x, -n));
|
||||||
n := round(Args[1].ResFloat);
|
// -n because fpc and Excel have different conventions regarding the sign
|
||||||
Result := FloatResult(RoundTo(ArgToFloat(Args[0]), -n));
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure fpsSIGN(var Result: TsExpressionResult; const Args: TsExprParameterArray);
|
procedure fpsSIGN(var Result: TsExpressionResult; const Args: TsExprParameterArray);
|
||||||
|
Reference in New Issue
Block a user