This could be simplified thusly:

```javascript
    return function(toFormat, options) {
        var formattedValue = toFormat.toString();
        options = options || {};

        if(options.hasOwnProperty(formattedValue)) {
            formattedValue = options[formattedValue];
        }

        return formattedValue;
    };
```