From 135063e550e20f97e57787515cb971e804bef3f1 Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Thu, 23 Nov 2017 16:24:01 +0100 Subject: [PATCH] Math fix --- Site/App_GlobalResources/Pages.Admin.designer.cs | 13 +++++++++++-- Site/App_GlobalResources/Pages.Admin.resx | 7 +++++-- Site/Pages/v5/Admin/BitcoinEchoTest.aspx | 4 ++-- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/Site/App_GlobalResources/Pages.Admin.designer.cs b/Site/App_GlobalResources/Pages.Admin.designer.cs index b1f24582..ebf8bead 100644 --- a/Site/App_GlobalResources/Pages.Admin.designer.cs +++ b/Site/App_GlobalResources/Pages.Admin.designer.cs @@ -61,7 +61,16 @@ namespace Resources.Pages { } /// - /// Looks up a localized string similar to This is a QR code for bitcoin echo testing for this entire Swarmops installation, not just for {0}. Read it from your phone's bitcoin wallet to perform the echo test, or donate from your computer directly to [{1}] (that's a Bitcoin Cash address). The amount (less miner fees) will be sent back to you in the next few seconds.. + /// Looks up a localized string similar to <strong>DUST COLLECTED</strong><br/><br/>The amount sent is smaller than the expected fee for returning it to you, which is {0} satoshis ({1} {2:N2}). The money you sent is now so-called "dust" on the bitcoin network, and won't be moved again.<br/><br/>Send a higher amount to perform an echo test.. + /// + internal static string BitcoinEchoTest_DustCollected { + get { + return ResourceManager.GetString("BitcoinEchoTest_DustCollected", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This is a QR code for bitcoin echo testing for this entire Swarmops installation, not just for {0}. Read it from your phone's bitcoin wallet to perform the echo test, or donate from your computer directly to [{1}] (that's a Bitcoin Cash address). The amount (less miner fees of {2:N2} microcoins) will be sent back to you in the next few seconds.. /// internal static string BitcoinEchoTest_Explain { get { @@ -88,7 +97,7 @@ namespace Resources.Pages { } /// - /// Looks up a localized string similar to This is a bitcoin echo test. It tests the hotwallet. If you send a small amount here, it will be sent back to you, minus the sendback transaction fee.. + /// Looks up a localized string similar to This is a bitcoin echo test. It tests the hotwallet. If you send a small amount here, it will be sent back to you, minus the sendback transaction fee (currently {0:N2} microcoins).. /// internal static string BitcoinEchoTest_Info { get { diff --git a/Site/App_GlobalResources/Pages.Admin.resx b/Site/App_GlobalResources/Pages.Admin.resx index 335c8cb8..70716530 100644 --- a/Site/App_GlobalResources/Pages.Admin.resx +++ b/Site/App_GlobalResources/Pages.Admin.resx @@ -118,7 +118,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - This is a QR code for bitcoin echo testing for this entire Swarmops installation, not just for {0}. Read it from your phone's bitcoin wallet to perform the echo test, or donate from your computer directly to [{1}] (that's a Bitcoin Cash address). The amount (less miner fees) will be sent back to you in the next few seconds. + This is a QR code for bitcoin echo testing for this entire Swarmops installation, not just for {0}. Read it from your phone's bitcoin wallet to perform the echo test, or donate from your computer directly to [{1}] (that's a Bitcoin Cash address). The amount (less miner fees of {2:N2} microcoins) will be sent back to you in the next few seconds. The {0} is the organization name. {1} is the bitcoin address for donations. @@ -130,7 +130,7 @@ Used if Bitcoin Cash is the org native currency. - This is a bitcoin echo test. It tests the hotwallet. If you send a small amount here, it will be sent back to you, minus the sendback transaction fee. + This is a bitcoin echo test. It tests the hotwallet. If you send a small amount here, it will be sent back to you, minus the sendback transaction fee (currently {0:N2} microcoins). Bitcoin Cash Hotwallet Echo Test @@ -370,4 +370,7 @@ Government + + <strong>DUST COLLECTED</strong><br/><br/>The amount sent is smaller than the expected fee for returning it to you, which is {0} satoshis ({1} {2:N2}). The money you sent is now so-called "dust" on the bitcoin network, and won't be moved again.<br/><br/>Send a higher amount to perform an echo test. + \ No newline at end of file diff --git a/Site/Pages/v5/Admin/BitcoinEchoTest.aspx b/Site/Pages/v5/Admin/BitcoinEchoTest.aspx index ad20f462..1956a5e1 100644 --- a/Site/Pages/v5/Admin/BitcoinEchoTest.aspx +++ b/Site/Pages/v5/Admin/BitcoinEchoTest.aspx @@ -34,7 +34,7 @@ $('#paraStatus').text(verifyingText); var donatedSatoshis = data.vout[index][outAddress]; console.log(donatedSatoshis); - sentFunds += Math.floor((donatedSatoshis * conversionRateSatoshisToCents) / 100.0); + sentFunds += (Math.floor(donatedSatoshis * conversionRateSatoshisToCents) / 100.0; odoSentCents.innerHTML = sentFunds; // looks weird but $('#id') not used with odo var json = {}; @@ -49,7 +49,7 @@ minerFees -= minerFeeCents; console.log(donatedSatoshis); console.log("Miner fee is " + minerFeeSatoshis + " satoshis, translating to " + minerFeeCents + " cents"); - returnedFunds += (Math.floor(((donatedSatoshis - minerFeeSatoshis) * conversionRateSatoshisToCents) / 100.0)); + returnedFunds += ((Math.floor(((donatedSatoshis - minerFeeSatoshis) * conversionRateSatoshisToCents)) / 100.0); odoMinerFeeCents.innerHTML = minerFees; odoReturnedCents.innerHTML = returnedFunds;