bitcoin/bitcoin — pull request #3061 by lano1106 (2013-10-07 04:26:54+00:00)
Title: Improve FormatMoney

3 possible cases for n: > 0, < 0 and == 0

Skip everything if == 0

reserve string memory for every valid Money values

Add sign first to avoid memory copy that inserting it at the end incur.

Remove a superfluous counter: nTrim

Eliminate 2 logical expression evaluations.

Signed-off-by: Olivier Langlois