Added configurable rounding to format function

Add features from #23