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);
|
||||
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);
|
||||
|
Reference in New Issue
Block a user