Make json full text for STAccount more legible.

This commit is contained in:
Arthur Britto
2012-08-17 17:08:23 -07:00
parent 27f4a2ce30
commit f2902ca014

View File

@@ -880,6 +880,30 @@ STAmount STAmount::deserialize(SerializerIterator& it)
}
std::string STAmount::getFullText() const
{
if (mIsNative)
{
return str(boost::format("%s/" SYSTEM_CURRENCY_CODE) % getText());
}
else if (!mIssuer)
{
return str(boost::format("%s/%s/0") % getText() % getHumanCurrency());
}
else if (mIssuer == ACCOUNT_ONE)
{
return str(boost::format("%s/%s/1") % getText() % getHumanCurrency());
}
else
{
return str(boost::format("%s/%s/%s")
% getText()
% getHumanCurrency()
% NewcoinAddress::createHumanAccountID(mIssuer));
}
}
#if 0
std::string STAmount::getExtendedText() const
{
if (mIsNative)
{
@@ -887,7 +911,7 @@ std::string STAmount::getFullText() const
}
else
{
return str(boost::format("%s %s/%s %dE%d" )
return str(boost::format("%s/%s/%s %dE%d" )
% getText()
% getHumanCurrency()
% NewcoinAddress::createHumanAccountID(mIssuer)
@@ -895,6 +919,7 @@ std::string STAmount::getFullText() const
% getExponent());
}
}
#endif
Json::Value STAmount::getJson(int) const
{