Yes, it is possible to reduce further for a cleaner result, but it will cost
function formatIfNumber(value, numberOfPlaces) { return value / 2 ? Number(Math.round(value+'e'+numberOfPlaces)+'e-'+numberOfPlaces) : value; }
- function formatIfNumber(value, numberOfPlaces) {
if(value / 2) {return Number(Math.round(value+'e'+numberOfPlaces)+'e-'+numberOfPlaces);}return value;- return value / 2 ? Number(Math.round(value+'e'+numberOfPlaces)+'e-'+numberOfPlaces) : value;
- }