Merge pull request #1197 from dimxy/heir-fix-precision
Heir fix precision
This commit is contained in:
@@ -404,7 +404,6 @@ int64_t IsTokensvout(bool goDeeper, bool checkPubkeys, struct CCcontract_info *c
|
|||||||
|
|
||||||
uint8_t evalCodeInOpret;
|
uint8_t evalCodeInOpret;
|
||||||
if (vopretExtra.size() >= 2 /*|| vopretExtra.size() != vopretExtra.begin()[0] <-- shold we check this?*/) {
|
if (vopretExtra.size() >= 2 /*|| vopretExtra.size() != vopretExtra.begin()[0] <-- shold we check this?*/) {
|
||||||
std::cerr << "IsTokensvout() empty or incorrect contract opret" << std::endl;
|
|
||||||
evalCodeInOpret = vopretExtra.begin()[1];
|
evalCodeInOpret = vopretExtra.begin()[1];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
|
|
||||||
#include "CCHeir.h"
|
#include "CCHeir.h"
|
||||||
#include "heir_validate.h"
|
#include "heir_validate.h"
|
||||||
|
#include <iomanip>
|
||||||
|
|
||||||
class CoinHelper;
|
class CoinHelper;
|
||||||
class TokenHelper;
|
class TokenHelper;
|
||||||
@@ -1160,7 +1161,7 @@ UniValue HeirInfo(uint256 fundingtxid)
|
|||||||
|
|
||||||
if (tokenid == zeroid) {
|
if (tokenid == zeroid) {
|
||||||
msg = "funding total in coins";
|
msg = "funding total in coins";
|
||||||
stream << (double)total / COIN;
|
stream << std::fixed << std::setprecision(8) << (double)total / COIN;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
msg = "funding total in tokens";
|
msg = "funding total in tokens";
|
||||||
@@ -1178,7 +1179,7 @@ UniValue HeirInfo(uint256 fundingtxid)
|
|||||||
|
|
||||||
if (tokenid == zeroid) {
|
if (tokenid == zeroid) {
|
||||||
msg = "funding available in coins";
|
msg = "funding available in coins";
|
||||||
stream << (double)inputs / COIN;
|
stream << std::fixed << std::setprecision(8) << (double)inputs / COIN;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
msg = "funding available in tokens";
|
msg = "funding available in tokens";
|
||||||
|
|||||||
Reference in New Issue
Block a user