function formatRolloverNumber({ format, decimals, yaxUnitsAppend, yaxUnits }) {
if (format === constants.format.count) {
return d => {
const pf = d % 1 !== 0 ? format(`,.${decimals}f`) : format(',.0f');
return yaxUnitsAppend ? pf(d) + yaxUnits : yaxUnits + pf(d);
};
} else {
return d => {
const fmtString = Number.isInteger(decimals) ? `.${decimals}%` : '%';
const pf = format(fmtString);
return pf(d);
};
}
}