Formats a string in the same way that the % formatting would use, but takes the current locale into account. Grouping is applied if the third parameter is true. Conversion uses monetary thousands separator and grouping strings if fourth parameter monetary is true.