dollar_format, percent_format now work correctly for zero length input

Now return `character()` if input has length zero.
Fixes issue 34.