mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Make json full text for STAccount more legible.
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user