mastercoin-MSC/mastercore — pull request #182 by dexX7 (2014-10-23 08:19:26+00:00)
Title: Extract and test Format_MP, add defaults

- Renamed FormatDivisibleMP to FormatDivisibleAmount
- Renamed FormatIndivisibleMP to FormatIndivisibleAmount
- Added FormatTokenAmount
- Format_Amount is now in namespace mastercore
- Format_Amount is available via mastercore_parse_string.h
- Old behavior not changed, but enhanced

FormatDivisibleAmount(int64_t n) and FormatIndivisibleAmount(int64_t n) without second parameter convert and format a number to string and add minus sign for *negative* numbers. If there is a use-case to enforce or suppress a sign (positive or negative), the second parameter can be used.

FormatTokenAmount(int64_t n) and FormatTokenAmount(int64_t n, bool divisible) add a minus sign for negative numbers and no sign for positive numbers. Per default (no second paramter provided) the result represents an indivisible amount.

There are quite a few lines which can be simplified, such as:
```c
std::string strAmount;

if (divisible)
strAmount = FormatDivisibleMP(nTokens);
else
strAmount = FormatIndivisibleMP(nTokens);
```
To:
```c++
std::string strAmount = FormatTokenAmount(nTokens, divisible);
```