File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ function DateToISO(const Value: TDate): string;
2222function ISOToDateTime (const Value : string): TDateTime;
2323function ISOToDate (const Value : string): TDate;
2424function BoolToParam (const Value : Boolean): string;
25+ function DoubleToParam (const Value : Double): string;
2526
2627resourcestring
2728 SInvalidDateFormat = ' Value %s is not a valid datetime' ;
@@ -44,6 +45,9 @@ TTimeZoneInfo = record
4445 IsUTC: Boolean;
4546 end ;
4647
48+ var
49+ InternalFormatSettings: TFormatSettings;
50+
4751function NewTimeZoneInfo : TTimeZoneInfo;
4852begin
4953 Result.HourOff := 0 ;
@@ -628,4 +632,13 @@ function BoolToParam(const Value: Boolean): string;
628632 Result := ' false' ;
629633end ;
630634
635+ function DoubleToParam (const Value : Double): string;
636+ begin
637+ Result := FloatToStr(Value , InternalFormatSettings);
638+ end ;
639+
640+
641+ initialization
642+ InternalFormatSettings := TFormatSettings.Create;
643+ InternalFormatSettings.DecimalSeparator := ' .' ;
631644end .
Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ TStringMetaType = class(TMetaType)
4949 TDoubleMetaType = class (TMetaType)
5050 public
5151 function TypeName : string; override;
52+ function CodeToParam (const ParamName: string): string; override;
5253 end ;
5354
5455 TIntegerMetaType = class (TMetaType)
@@ -388,6 +389,11 @@ function TObjectMetaType.TypeName: string;
388389
389390{ TDoubleMetaType }
390391
392+ function TDoubleMetaType.CodeToParam (const ParamName: string): string;
393+ begin
394+ Result := Format(' DoubleToParam(%s)' , [ParamName]);
395+ end ;
396+
391397function TDoubleMetaType.TypeName : string;
392398begin
393399 Result := ' Double' ;
You can’t perform that action at this time.
0 commit comments