diff --git a/domain-server/src/DomainServer.cpp b/domain-server/src/DomainServer.cpp index 7224f9eec8..d83ba5772b 100644 --- a/domain-server/src/DomainServer.cpp +++ b/domain-server/src/DomainServer.cpp @@ -735,7 +735,7 @@ void DomainServer::setupPendingAssignmentCredits() { const float CREDITS_PER_HOUR = 0.10f; const float CREDITS_PER_MSEC = CREDITS_PER_HOUR / (60 * 60 * 1000); - const int SATOSHIS_PER_MSEC = CREDITS_PER_MSEC * powf(10.0f, 8.0f); + const int SATOSHIS_PER_MSEC = CREDITS_PER_MSEC * SATOSHIS_PER_UNIT; float pendingCredits = elapsedMsecsSinceLastPayment * SATOSHIS_PER_MSEC; @@ -887,7 +887,7 @@ QJsonObject DomainServer::jsonObjectForNode(const SharedNodePointer& node) { double pendingCreditAmount = 0; while (i != _pendingAssignmentCredits.end() && i.key() == nodeData->getWalletUUID()) { - pendingCreditAmount += i.value()->getAmount() * powf(10.0f, -8.0f); + pendingCreditAmount += i.value()->getAmount() / SATOSHIS_PER_CREDIT; ++i; } diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 1bf284a00f..8d8c098fe0 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -3108,7 +3108,7 @@ void Application::updateWindowTitle(){ AccountManager& accountManager = AccountManager::getInstance(); if (accountManager.getAccountInfo().hasBalance()) { - float creditBalance = accountManager.getAccountInfo().getBalance() * pow(10.0f, -8.0f); + float creditBalance = accountManager.getAccountInfo().getBalance() / SATOSHIS_PER_CREDIT; QString creditBalanceString; creditBalanceString.sprintf("%.8f", creditBalance); diff --git a/libraries/networking/src/DataServerAccountInfo.h b/libraries/networking/src/DataServerAccountInfo.h index 9bc4fbb37c..f37e05ff63 100644 --- a/libraries/networking/src/DataServerAccountInfo.h +++ b/libraries/networking/src/DataServerAccountInfo.h @@ -16,6 +16,8 @@ #include "OAuthAccessToken.h" +const float SATOSHIS_PER_CREDIT = 10.0e8f; + class DataServerAccountInfo : public QObject { Q_OBJECT public: