Simple decimal formatter function

There is now a simple decimal formatter function, which supports
grouping of the integer part as well as proper rounding to the
desired number of decimal places. Use with caution: the implementation
may still have some quirks...