fixed a bug in decimalToPrecision: rounding for equidistant digits (see #2407)

[ci skip]
This tag has no release notes.