R package: Convert numbers to a specified notation or format