Per the docs
format(String, List<String>)
Treat the current string as a pattern that should be used for substitution in the same manner as
apex:outputText
.
Which would lead me to think this would be a great function
public static String toCurrencyString(Decimal input) {
return String.format('{0,number,currency}', new String[] { input.format());
}
But that just throws a System.StringException: Cannot format given Object as a Number
Is there anyway to use this function for more than just basic string substitution? Or should I just consider this apparent platform bug one of those special Salesforce "features" that will never get fixed.