void BalanceCheck_Tick(object sender, EventArgs e) { if (VerifyMiningAddress(false)) { Helpers.ConsolePrint("NICEHASH", "Balance get"); double Balance = NiceHashStats.GetBalance(textBoxBTCAddress.Text.Trim(), textBoxBTCAddress.Text.Trim() + "." + textBoxWorkerName.Text.Trim()); if (Balance > 0) { if (ConfigManager.GeneralConfig.AutoScaleBTCValues && Balance < 0.1) { toolStripStatusLabelBalanceBTCCode.Text = "mBTC"; toolStripStatusLabelBalanceBTCValue.Text = (Balance * 1000).ToString("F5", CultureInfo.InvariantCulture); } else { toolStripStatusLabelBalanceBTCCode.Text = "BTC"; toolStripStatusLabelBalanceBTCValue.Text = Balance.ToString("F6", CultureInfo.InvariantCulture); } //Helpers.ConsolePrint("CurrencyConverter", "Using CurrencyConverter" + ConfigManager.Instance.GeneralConfig.DisplayCurrency); double Amount = (Balance * Globals.BitcoinRate); Amount = CurrencyConverter.ConvertToActiveCurrency(Amount); toolStripStatusLabelBalanceDollarText.Text = Amount.ToString("F2", CultureInfo.InvariantCulture); } } }
private void UpdateGlobalRate() { double TotalRate = MinersManager.GetTotalRate(); if (ConfigManager.GeneralConfig.AutoScaleBTCValues && TotalRate < 0.1) { toolStripStatusLabelBTCDayText.Text = "mBTC/" + International.GetText("Day"); toolStripStatusLabelGlobalRateValue.Text = (TotalRate * 1000).ToString("F5", CultureInfo.InvariantCulture); } else { toolStripStatusLabelBTCDayText.Text = "BTC/" + International.GetText("Day"); toolStripStatusLabelGlobalRateValue.Text = (TotalRate).ToString("F6", CultureInfo.InvariantCulture); } toolStripStatusLabelBTCDayValue.Text = CurrencyConverter.ConvertToActiveCurrency((TotalRate * Globals.BitcoinRate)).ToString("F2", CultureInfo.InvariantCulture); }
public void AddRateInfo(string groupName, string deviceStringInfo, APIData iAPIData, double paying, bool isApiGetException) { string ApiGetExceptionString = isApiGetException ? "**" : ""; string speedString = Helpers.FormatSpeedOutput(iAPIData.Speed) + iAPIData.AlgorithmName + ApiGetExceptionString; if (iAPIData.AlgorithmID == AlgorithmType.Equihash) { speedString = speedString.Replace("H/s", "Sols/s"); } string rateBTCString = FormatPayingOutput(paying); string rateCurrencyString = CurrencyConverter.ConvertToActiveCurrency(paying * Globals.BitcoinRate).ToString("F2", CultureInfo.InvariantCulture) + String.Format(" {0}/", CurrencyConverter.ActiveDisplayCurrency) + International.GetText("Day"); ((GroupProfitControl)flowLayoutPanelRates.Controls[flowLayoutPanelRatesIndex++]) .UpdateProfitStats(groupName, deviceStringInfo, speedString, rateBTCString, rateCurrencyString); UpdateGlobalRate(); }