Skip to content

Commit

Permalink
Fix output of approximate value using fixed denominator in some cases
Browse files Browse the repository at this point in the history
  • Loading branch information
hanna-kn committed Nov 26, 2023
1 parent b5e7d55 commit 1984f1d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libqalculate/MathStructure-print.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2823,7 +2823,7 @@ void MathStructure::formatsub(const PrintOptions &po, MathStructure *parent, siz
if(!force_fraction && (isApproximate() || (top_parent && top_parent->isApproximate()))) ips_n.parent_approximate = true;

// if current mode and parent precision dictates showing of ending zeroes, number is not shown as fraction
if(po.show_ending_zeroes && po.restrict_to_parent_precision && ips_n.parent_approximate && po.base != BASE_ROMAN_NUMERALS && po.base != BASE_BIJECTIVE_26 && (o_number.numeratorIsGreaterThan(9) || o_number.numeratorIsLessThan(-9) || o_number.denominatorIsGreaterThan(9))) {
if(po.show_ending_zeroes && po.restrict_to_parent_precision && ips_n.parent_approximate && po.base != BASE_ROMAN_NUMERALS && po.base != BASE_BIJECTIVE_26 && po.number_fraction_format != FRACTION_FRACTIONAL_FIXED_DENOMINATOR && po.number_fraction_format != FRACTION_COMBINED_FIXED_DENOMINATOR && (o_number.numeratorIsGreaterThan(9) || o_number.numeratorIsLessThan(-9) || o_number.denominatorIsGreaterThan(9))) {
break;
}
ips_n.parent_precision = precision();
Expand Down

0 comments on commit 1984f1d

Please sign in to comment.