simplified formatNonZeroFractionOutput()