mkedobbs
mkedobbs

Reputation: 4375

String representation of small amounts of money

Formatting large amounts of money is not an issue (e.g. converting a decimal to dollars):

myDecimal.ToString("C", {some culture info});

However, my current problem is dealing with very small amounts of money (e.g. cents/pence, etc.) and rather than formatting 5 cents as $0.05 (or 5 pence as £0.05), I need to format as 5¢ or 5p. Is there anything built in to the .NET framework to handle this? Or am I stuck rolling my own?

Upvotes: 1

Views: 208

Answers (1)

Marc Gravell
Marc Gravell

Reputation: 1063338

I'm pretty certain that you're on your own, I'm afraid. Sorry that doesn't help much.

There is only NumberFormatInfo.CurrencySymbol - nothing more granular.

Upvotes: 2

Related Questions