fixed some conversion bug
This commit is contained in:
parent
42261a01b5
commit
de3e8f80ff
@ -92,6 +92,8 @@ namespace NadekoBot.Modules.Searches.Commands
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
CultureInfo ci = new CultureInfo("en-US");
|
||||||
|
Thread.CurrentThread.CurrentCulture = ci;
|
||||||
reInitCurrencyConverterTable();
|
reInitCurrencyConverterTable();
|
||||||
Unit inUnit = currTable.CreateUnit(quantity, from.ToUpperInvariant());
|
Unit inUnit = currTable.CreateUnit(quantity, from.ToUpperInvariant());
|
||||||
Unit outUnit = inUnit.Convert(currTable.CurrencyCode(to.ToUpperInvariant()));
|
Unit outUnit = inUnit.Convert(currTable.CurrencyCode(to.ToUpperInvariant()));
|
||||||
@ -109,9 +111,16 @@ namespace NadekoBot.Modules.Searches.Commands
|
|||||||
{
|
{
|
||||||
if (lastChanged == null || lastChanged.DayOfYear != DateTime.Now.DayOfYear)
|
if (lastChanged == null || lastChanged.DayOfYear != DateTime.Now.DayOfYear)
|
||||||
{
|
{
|
||||||
exchangeRateProvider = new WebExchangeRatesProvider();
|
try
|
||||||
currTable = new CurrencyExchangeTable(exchangeRateProvider);
|
{
|
||||||
lastChanged = DateTime.Now;
|
exchangeRateProvider = new WebExchangeRatesProvider();
|
||||||
|
currTable = new CurrencyExchangeTable(exchangeRateProvider);
|
||||||
|
lastChanged = DateTime.Now;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
Console.WriteLine("Error with the currency download.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user