|
@@ -1166,6 +1166,8 @@ procedure TCustomSqliteDataset.SetFieldData(Field: TField; Buffer: Pointer;
|
|
NativeFormat: Boolean);
|
|
NativeFormat: Boolean);
|
|
var
|
|
var
|
|
TempStr:String;
|
|
TempStr:String;
|
|
|
|
+ FloatStr: PChar;
|
|
|
|
+ FloatLen: Integer;
|
|
begin
|
|
begin
|
|
if not (State in [dsEdit, dsInsert]) then
|
|
if not (State in [dsEdit, dsInsert]) then
|
|
DatabaseErrorFmt(SNotEditing,[Name],Self);
|
|
DatabaseErrorFmt(SNotEditing,[Name],Self);
|
|
@@ -1192,11 +1194,22 @@ begin
|
|
end;
|
|
end;
|
|
ftFloat,ftDateTime,ftDate,ftTime,ftCurrency:
|
|
ftFloat,ftDateTime,ftDate,ftTime,ftCurrency:
|
|
begin
|
|
begin
|
|
- Str(Double(Buffer^),TempStr);
|
|
|
|
- FCacheItem^.Row[Pred(Field.FieldNo)]:=StrAlloc(Length(TempStr));
|
|
|
|
- //Skips the first space that str returns
|
|
|
|
- //todo: make a custom Str?
|
|
|
|
- Move((PChar(TempStr)+1)^,(FCacheItem^.Row[Pred(Field.FieldNo)])^,Length(TempStr));
|
|
|
|
|
|
+ Str(Double(Buffer^),TempStr);
|
|
|
|
+ //Str returns a space as the first character for positive values
|
|
|
|
+ //and the - sign for negative values. It's necessary to remove the extra
|
|
|
|
+ //space while keeping the - sign
|
|
|
|
+ if TempStr[1] = ' ' then
|
|
|
|
+ begin
|
|
|
|
+ FloatStr := PChar(TempStr) + 1;
|
|
|
|
+ FloatLen := Length(TempStr);
|
|
|
|
+ end
|
|
|
|
+ else
|
|
|
|
+ begin
|
|
|
|
+ FloatStr := PChar(TempStr);
|
|
|
|
+ FloatLen := Length(TempStr) + 1;
|
|
|
|
+ end;
|
|
|
|
+ FCacheItem^.Row[Pred(Field.FieldNo)] := StrAlloc(FloatLen);
|
|
|
|
+ Move(FloatStr^, (FCacheItem^.Row[Pred(Field.FieldNo)])^, FloatLen);
|
|
end;
|
|
end;
|
|
ftLargeInt:
|
|
ftLargeInt:
|
|
begin
|
|
begin
|