Hi,
I'm having a issue with TJSONNumber, that if I add a TJSONPair in a TJSONObject with the following code jObject.AddPair(Name,IntValue), later then reading the value as TJSONNumber(jValue).AsInt it always return 0.
I have noticed that the TJSONNumber class Create member does not assign any value to the private fields.(TJSONBool do assign private field value from the paramater).
I have changed to the following as a workaround.
constructor TJSONNumber.Create(ANumber: integer);
begin
inherited Create;
jv := ANumber;
FInt := ANumber;
FInt64 := ANumber;
FDouble := ANumber;
end;
constructor TJSONNumber.Create(ANumber: Int64);
begin
inherited Create;
FInt := Integer(ANumber);
FInt64 := ANumber;
FDouble := ANumber;
jv := ANumber;
end;
constructor TJSONNumber.Create(ANumber: double);
begin
inherited Create;
jv := ANumber;
FInt := Trunc(ANumber);
FInt64 := Trunc(ANumber);
FDouble := ANumber;
end;
Thanks in advance,
Omar Zelaya