Skip to content

Commit

Permalink
Added 'formatfloat' to TemplatePro
Browse files Browse the repository at this point in the history
  • Loading branch information
danieleteti committed Dec 24, 2024
1 parent 7d599a3 commit a5ecfb5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sources/TemplatePro.pas
Original file line number Diff line number Diff line change
Expand Up @@ -2231,6 +2231,12 @@ function TTProCompiledTemplate.ExecuteFilter(aFunctionName: string; var aParamet
FunctionError(aFunctionName, 'Invalid datetime ' + aValue.AsString.QuotedString);
end;
end
else if SameText(aFunctionName, 'formatfloat') then
begin
CheckParNumber(1, aParameters);
CheckParamType('formatfloat', @aParameters[0], [TFilterParameterType.fptString]);
Result := FormatFloat(aParameters[0].ParStrText, aValue.AsExtended, fLocaleFormatSettings);
end
else if SameText(aFunctionName, 'totrue') then
begin
CheckParNumber(0, aParameters);
Expand Down

0 comments on commit a5ecfb5

Please sign in to comment.