Skip to content

Commit

Permalink
Fix wrong rounding from Float to Integer in CreateJsonForBoldAttribute
Browse files Browse the repository at this point in the history
  • Loading branch information
bero committed Dec 7, 2024
1 parent 45e848b commit cabfd3b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Source/BoldObjectRepresentationJson.pas
Original file line number Diff line number Diff line change
Expand Up @@ -536,8 +536,13 @@ function TBoldElementJsonConverter.CreateJsonForBoldAttribute(aBoldAttribute: TB
end
else if (aBoldAttribute is TBANumeric) then
begin
vInt := vMemberValueAsVariant;
Result := TJSONNumber.Create(vInt);
if (aBoldAttribute is TBAFloat) or (aBoldAttribute is TBACurrency) then
Result := TJSONNumber.Create(TBANumeric(aBoldAttribute).AsFloat)
else
begin
vInt := vMemberValueAsVariant;
Result := TJSONNumber.Create(vInt);
end;
end
else if aBoldAttribute is TBABoolean then
begin
Expand Down

0 comments on commit cabfd3b

Please sign in to comment.