| 729 | } |
| 730 | |
| 731 | QString formatAssetAmount(const CAsset& asset, const CAmount& amount, const int bitcoin_unit, BitcoinUnits::SeparatorStyle separators, bool include_asset_name) |
| 732 | { |
| 733 | if (asset == Params().GetConsensus().pegged_asset) { |
| 734 | if (include_asset_name) { |
| 735 | return BitcoinUnits::formatWithUnit(bitcoin_unit, amount, false, separators); |
| 736 | } else { |
| 737 | return BitcoinUnits::format(bitcoin_unit, amount, false, separators); |
| 738 | } |
| 739 | } |
| 740 | |
| 741 | qlonglong abs = qAbs(amount); |
| 742 | qlonglong whole = abs / 100000000; |
| 743 | qlonglong fraction = abs % 100000000; |
| 744 | QString str = QString("%1").arg(whole); |
| 745 | if (amount < 0) { |
| 746 | str.insert(0, '-'); |
| 747 | } |
| 748 | if (fraction) { |
| 749 | str += QString(".%1").arg(fraction, 8, 10, QLatin1Char('0')); |
| 750 | } |
| 751 | if (include_asset_name) { |
| 752 | str += QString(" ") + QString::fromStdString(gAssetsDir.GetIdentifier(asset)); |
| 753 | } |
| 754 | return str; |
| 755 | } |
| 756 | |
| 757 | QString formatMultiAssetAmount(const CAmountMap& amountmap, const int bitcoin_unit, BitcoinUnits::SeparatorStyle separators, QString line_separator) |
| 758 | { |
no test coverage detected