static void Main(string[] args)
        {
            var converter = new ConverterModel();

            while (true)
            {
                Console.Write(">");

                var input = Console.ReadLine();

                if (input == "exit")
                {
                    break;
                }
                else
                {
                    converter.InputText.Value = input;

                    if (converter.HasError.Value != true)
                    {
                        Console.WriteLine($"Input Type : {converter.InputType.Value}");

                        Console.WriteLine($"Output Type : {converter.OutputType.Value}");

                        Console.WriteLine($"Output Text : {converter.OutputText.Value}");
                    }
                    else
                    {
                        Console.WriteLine($"Error : {converter.ErrorMessage.Value}");
                    }

                    Console.WriteLine();
                }
            }
        }
Exemplo n.º 2
0
 public ItemsPage()
 {
     InitializeComponent();
     Title = "Converter";
     btnChangeCalcMode.Text = "<-->";
     curCalcMode            = CalcMode.PSI_TO_BAR;
     BindingContext         = new ConverterModel();
 }
Exemplo n.º 3
0
        public Dictionary <string, decimal> Converter(ConverterModel converterModel)
        {
            var from = Convert.ToDecimal(converterModel.Quotes.Where(x => x.Key.Substring(3) == converterModel.From).FirstOrDefault().Value);

            var convertedValues = CurrencyConverter(from, converterModel.Value, converterModel.Currencies, converterModel.Quotes);

            return(convertedValues);
        }
Exemplo n.º 4
0
        public ConverterViewModel()
        {
            converterModel = new ConverterModel
            {
                USDCurrency = 0,
                IsValid     = true
            };

            ConvertCommand = new RelayCommand(() => ExecuteConvertCommand());
        }
Exemplo n.º 5
0
 public async Task <Dictionary <string, decimal> > GetCalculatedCurrency(ConverterModel converterModel)
 {
     try
     {
         return(await HttpHelper.GetAsync <Dictionary <string, decimal> >(URL_CURRENCY_CONVERTER_API, converterModel));
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemplo n.º 6
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            var history            = new ObservableCollection <string>();
            var model              = new ConverterModel(s => s.ToUpper(), history);
            var converterPresenter = new ConverterPresenter(model, history);
            var mainWindow         = new MainWindow {
                DataContext = converterPresenter
            };

            mainWindow.Show();
        }
Exemplo n.º 7
0
        public JsonResult ConvertShit(ConverterModel cm)
        {
            ConverterModel cm2 = new ConverterModel();

            if (cm.offline)
            {
                cm2.amount = Utility.ConvertOffline.resultConvertOffline(cm);
            }
            else
            {
                cm2 = Utility.APIQuery.GetCurrency(cm);
            }
            return(Json(cm2.amount));
        }
        public IActionResult Export(ConverterModel model)
        {
            MemoryStream ms = new MemoryStream();

            byte[]       fileBytes;
            XMLConverter converter;

            if (model.UploadType == "text")
            {
                converter = new XMLConverter(model.XML);
            }
            else
            {
                string xml = string.Empty;
                xml       = new StreamReader(model.FileUpload.OpenReadStream()).ReadToEnd();
                converter = new XMLConverter(xml);
            }

            string fileName = "export";
            string mimeType = "text/plain";

            FileContentResult result;

            using (StreamWriter sw = new StreamWriter(ms))
            {
                if (model.ConvertTo == "csv")
                {
                    sw.Write(converter.GetCSV());
                    fileName = "export.csv";
                    mimeType = "text/csv";
                }
                else
                {
                    sw.Write(converter.GetJson());
                    fileName = "export.json";
                    mimeType = "application/json";
                }

                fileBytes = ms.GetBuffer();
            }

            result = File(fileBytes, mimeType, fileName);

            return(result);
        }
Exemplo n.º 9
0
        public async Task <IActionResult> Calculated(string from, string value)
        {
            var currencyLayerData = await _currencyService.GetCurrencyLayerData();

            ConverterModel converterModel = new ConverterModel
            {
                From       = from,
                Value      = Convert.ToDecimal(value),
                Currencies = currencyLayerData.CurrencyListModel.Currencies,
                Quotes     = currencyLayerData.CurrencyQuotesModel.Quotes
            };

            var calculatedValues = await _currencyService.GetCalculatedCurrency(converterModel);

            currencyLayerData.ConvertedValues = calculatedValues;
            currencyLayerData.Value           = Convert.ToDecimal(value);
            currencyLayerData.From            = from;

            return(View(currencyLayerData));
        }
Exemplo n.º 10
0
        /// <summary>
        /// Appel de l'API d'un webservice afin de convertir un montant d'une devise à une autre
        /// </summary>
        /// <param name="cm"></param>
        /// <returns></returns>
        public static ConverterModel GetCurrency(ConverterModel cm)
        {
            //Appel de l'API
            var    client = new WebClient();
            string query  = API_URL + API_KEY + "&from=" + cm.From + "&to=" + cm.To + "&amount=" + cm.amount;
            //On force le point à la place de la première virgule dans l'url
            //var regex = new Regex(Regex.Escape(","));
            //var filteredQuery = regex.Replace(query, ".", 1);

            //Reponse de l'api
            string response = client.DownloadString(query);

            var cm2 = new ConverterModel();
            var obj = JObject.Parse(response);

            cm2.amount = (string)obj["amount"];
            cm2.From   = cm.From;
            cm2.To     = cm.To;
            //Retour du model à envoyer à la vue
            return(cm2);
        }
Exemplo n.º 11
0
 public async Task <Dictionary <string, decimal> > GetCalculatedCurrency(ConverterModel converterModel)
 {
     return(_currencyDataModel.ConvertedValues);
 }
Exemplo n.º 12
0
        public async Task <IActionResult> ConvertPriceAsync([FromBody] ConverterModel converterModel)
        {
            var resultConverting = await _orderService.ConvertPriceAsync(converterModel);

            return(Ok(resultConverting));
        }
Exemplo n.º 13
0
 public ActionResult <Dictionary <string, decimal> > Get(ConverterModel converterModel)
 {
     return(_convertService.Converter(converterModel));
 }
Exemplo n.º 14
0
 public ConverterPresenter(ConverterModel model, ObservableCollection <string> history) => (_model, History) = (model, history);
Exemplo n.º 15
0
 public ConverterViewModel()
 {
     ConverterModel = new ConverterModel();
 }
Exemplo n.º 16
0
        public void Get_Converted_Currencies()
        {
            var converterModelMock = new ConverterModel
            {
                From       = "BRL",
                Value      = 100,
                Currencies = new Dictionary <string, string>()
                {
                    { "AED", "United Arab Emirates Dirham" },
                    { "AFN", "Afghan Afghani" },
                    { "ALL", "Albanian Lek" },
                    { "AMD", "Armenian Dram" },
                    { "ANG", "Netherlands Antillean Guilder" },
                    { "AOA", "Angolan Kwanza" },
                    { "ARS", "Argentine Peso" },
                    { "AUD", "Australian Dollar" },
                    { "AWG", "Aruban Florin" },
                    { "AZN", "Azerbaijani Manat" },
                    { "BAM", "Bosnia-Herzegovina Convertible Mark" },
                    { "BBD", "Barbadian Dollar" },
                    { "BDT", "Bangladeshi Taka" },
                    { "BGN", "Bulgarian Lev" },
                    { "BHD", "Bahraini Dinar" },
                    { "BIF", "Burundian Franc" },
                    { "BMD", "Bermudan Dollar" },
                    { "BND", "Brunei Dollar" },
                    { "BOB", "Bolivian Boliviano" },
                    { "BRL", "Brazilian Real" },
                    { "BSD", "Bahamian Dollar" },
                    { "BTC", "Bitcoin" },
                    { "BTN", "Bhutanese Ngultrum" },
                    { "BWP", "Botswanan Pula" },
                    { "BYN", "New Belarusian Ruble" },
                    { "BYR", "Belarusian Ruble" },
                    { "BZD", "Belize Dollar" },
                    { "CAD", "Canadian Dollar" },
                    { "CDF", "Congolese Franc" },
                    { "CHF", "Swiss Franc" },
                    { "CLF", "Chilean Unit of Account (UF)" },
                    { "CLP", "Chilean Peso" },
                    { "CNY", "Chinese Yuan" },
                    { "COP", "Colombian Peso" },
                    { "CRC", "Costa Rican Colón" },
                    { "CUC", "Cuban Convertible Peso" },
                    { "CUP", "Cuban Peso" },
                    { "CVE", "Cape Verdean Escudo" },
                    { "CZK", "Czech Republic Koruna" },
                    { "DJF", "Djiboutian Franc" },
                    { "DKK", "Danish Krone" },
                    { "DOP", "Dominican Peso" },
                    { "DZD", "Algerian Dinar" },
                    { "EGP", "Egyptian Pound" },
                    { "ERN", "Eritrean Nakfa" },
                    { "ETB", "Ethiopian Birr" },
                    { "EUR", "Euro" },
                    { "FJD", "Fijian Dollar" },
                    { "FKP", "Falkland Islands Pound" },
                    { "GBP", "British Pound Sterling" },
                    { "GEL", "Georgian Lari" },
                    { "GGP", "Guernsey Pound" },
                    { "GHS", "Ghanaian Cedi" },
                    { "GIP", "Gibraltar Pound" },
                    { "GMD", "Gambian Dalasi" },
                    { "GNF", "Guinean Franc" },
                    { "GTQ", "Guatemalan Quetzal" },
                    { "GYD", "Guyanaese Dollar" },
                    { "HKD", "Hong Kong Dollar" },
                    { "HNL", "Honduran Lempira" },
                    { "HRK", "Croatian Kuna" },
                    { "HTG", "Haitian Gourde" },
                    { "HUF", "Hungarian Forint" },
                    { "IDR", "Indonesian Rupiah" },
                    { "ILS", "Israeli New Sheqel" },
                    { "IMP", "Manx pound" },
                    { "INR", "Indian Rupee" },
                    { "IQD", "Iraqi Dinar" },
                    { "IRR", "Iranian Rial" },
                    { "ISK", "Icelandic Króna" },
                    { "JEP", "Jersey Pound" },
                    { "JMD", "Jamaican Dollar" },
                    { "JOD", "Jordanian Dinar" },
                    { "JPY", "Japanese Yen" },
                    { "KES", "Kenyan Shilling" },
                    { "KGS", "Kyrgystani Som" },
                    { "KHR", "Cambodian Riel" },
                    { "KMF", "Comorian Franc" },
                    { "KPW", "North Korean Won" },
                    { "KRW", "South Korean Won" },
                    { "KWD", "Kuwaiti Dinar" },
                    { "KYD", "Cayman Islands Dollar" },
                    { "KZT", "Kazakhstani Tenge" },
                    { "LAK", "Laotian Kip" },
                    { "LBP", "Lebanese Pound" },
                    { "LKR", "Sri Lankan Rupee" },
                    { "LRD", "Liberian Dollar" },
                    { "LSL", "Lesotho Loti" },
                    { "LTL", "Lithuanian Litas" },
                    { "LVL", "Latvian Lats" },
                    { "LYD", "Libyan Dinar" },
                    { "MAD", "Moroccan Dirham" },
                    { "MDL", "Moldovan Leu" },
                    { "MGA", "Malagasy Ariary" },
                    { "MKD", "Macedonian Denar" },
                    { "MMK", "Myanma Kyat" },
                    { "MNT", "Mongolian Tugrik" },
                    { "MOP", "Macanese Pataca" },
                    { "MRO", "Mauritanian Ouguiya" },
                    { "MUR", "Mauritian Rupee" },
                    { "MVR", "Maldivian Rufiyaa" },
                    { "MWK", "Malawian Kwacha" },
                    { "MXN", "Mexican Peso" },
                    { "MYR", "Malaysian Ringgit" },
                    { "MZN", "Mozambican Metical" },
                    { "NAD", "Namibian Dollar" },
                    { "NGN", "Nigerian Naira" },
                    { "NIO", "Nicaraguan Córdoba" },
                    { "NOK", "Norwegian Krone" },
                    { "NPR", "Nepalese Rupee" },
                    { "NZD", "New Zealand Dollar" },
                    { "OMR", "Omani Rial" },
                    { "PAB", "Panamanian Balboa" },
                    { "PEN", "Peruvian Nuevo Sol" },
                    { "PGK", "Papua New Guinean Kina" },
                    { "PHP", "Philippine Peso" },
                    { "PKR", "Pakistani Rupee" },
                    { "PLN", "Polish Zloty" },
                    { "PYG", "Paraguayan Guarani" },
                    { "QAR", "Qatari Rial" },
                    { "RON", "Romanian Leu" },
                    { "RSD", "Serbian Dinar" },
                    { "RUB", "Russian Ruble" },
                    { "RWF", "Rwandan Franc" },
                    { "SAR", "Saudi Riyal" },
                    { "SBD", "Solomon Islands Dollar" },
                    { "SCR", "Seychellois Rupee" },
                    { "SDG", "Sudanese Pound" },
                    { "SEK", "Swedish Krona" },
                    { "SGD", "Singapore Dollar" },
                    { "SHP", "Saint Helena Pound" },
                    { "SLL", "Sierra Leonean Leone" },
                    { "SOS", "Somali Shilling" },
                    { "SRD", "Surinamese Dollar" },
                    { "STD", "São Tomé and Príncipe Dobra" },
                    { "SVC", "Salvadoran Colón" },
                    { "SYP", "Syrian Pound" },
                    { "SZL", "Swazi Lilangeni" },
                    { "THB", "Thai Baht" },
                    { "TJS", "Tajikistani Somoni" },
                    { "TMT", "Turkmenistani Manat" },
                    { "TND", "Tunisian Dinar" },
                    { "TOP", "Tongan Paʻanga" },
                    { "TRY", "Turkish Lira" },
                    { "TTD", "Trinidad and Tobago Dollar" },
                    { "TWD", "New Taiwan Dollar" },
                    { "TZS", "Tanzanian Shilling" },
                    { "UAH", "Ukrainian Hryvnia" },
                    { "UGX", "Ugandan Shilling" },
                    { "USD", "United States Dollar" },
                    { "UYU", "Uruguayan Peso" },
                    { "UZS", "Uzbekistan Som" },
                    { "VEF", "Venezuelan Bolívar Fuerte" },
                    { "VND", "Vietnamese Dong" },
                    { "VUV", "Vanuatu Vatu" },
                    { "WST", "Samoan Tala" },
                    { "XAF", "CFA Franc BEAC" },
                    { "XAG", "Silver (troy ounce)" },
                    { "XAU", "Gold (troy ounce)" },
                    { "XCD", "East Caribbean Dollar" },
                    { "XDR", "Special Drawing Rights" },
                    { "XOF", "CFA Franc BCEAO" },
                    { "XPF", "CFP Franc" },
                    { "YER", "Yemeni Rial" },
                    { "ZAR", "South African Rand" },
                    { "ZMK", "Zambian Kwacha (pre-2013)" },
                    { "ZMW", "Zambian Kwacha" },
                    { "ZWL", "Zimbabwean Dollar" }
                },
                Quotes = new Dictionary <string, double>()
                {
                    { "USDAED", 3.673042 },
                    { "USDAFN", 75.730404 },
                    { "USDALL", 109.960403 },
                    { "USDAMD", 484.270403 },
                    { "USDANG", 1.83145 },
                    { "USDAOA", 317.256504 },
                    { "USDARS", 40.931041 },
                    { "USDAUD", 1.411041 },
                    { "USDAWG", 1.801 },
                    { "USDAZN", 1.705041 },
                    { "USDBAM", 1.72765 },
                    { "USDBBD", 1.9931 },
                    { "USDBDT", 83.754041 },
                    { "USDBGN", 1.729804 },
                    { "USDBHD", 0.376305 },
                    { "USDBIF", 1802.65 },
                    { "USDBMD", 1.0 },
                    { "USDBND", 1.349041 },
                    { "USDBOB", 6.89185 },
                    { "USDBRL", 3.905504 },
                    { "USDBSD", 0.99811 },
                    { "USDBTC", 0.00025 },
                    { "USDBTN", 69.182606 },
                    { "USDBWP", 10.680504 },
                    { "USDBYN", 2.10795 },
                    { "USDBYR", 19600.0 },
                    { "USDBZD", 2.01115 },
                    { "USDCAD", 1.344655 },
                    { "USDCDF", 1634.000362 },
                    { "USDCHF", 0.992775 },
                    { "USDCLF", 0.025048 },
                    { "USDCLP", 671.825041 },
                    { "USDCNY", 6.718204 },
                    { "USDCOP", 3083.05 },
                    { "USDCRC", 598.505041 },
                    { "USDCUC", 1.0 },
                    { "USDCUP", 26.5 },
                    { "USDCVE", 97.40704 },
                    { "USDCZK", 22.78804 },
                    { "USDDJF", 177.720394 },
                    { "USDDKK", 6.603604 },
                    { "USDDOP", 50.657504 },
                    { "USDDZD", 119.030393 },
                    { "USDEGP", 17.221504 },
                    { "USDERN", 15.000358 },
                    { "USDETB", 28.49404 },
                    { "USDEUR", 0.883355 },
                    { "USDFJD", 2.127704 },
                    { "USDFKP", 0.760045 },
                    { "USDGBP", 0.75663 },
                    { "USDGEL", 2.680391 },
                    { "USDGGP", 0.756856 },
                    { "USDGHS", 5.089604 },
                    { "USDGIP", 0.760045 },
                    { "USDGMD", 49.703853 },
                    { "USDGNF", 9104.503851 },
                    { "USDGTQ", 7.665304 },
                    { "USDGYD", 208.28504 },
                    { "USDHKD", 7.847404 },
                    { "USDHNL", 24.395504 },
                    { "USDHRK", 6.574204 },
                    { "USDHTG", 83.75504 },
                    { "USDHUF", 280.290388 },
                    { "USDIDR", 14307.5 },
                    { "USDILS", 3.621704 },
                    { "USDIMP", 0.756856 },
                    { "USDINR", 69.170504 },
                    { "USDIQD", 1190.9 },
                    { "USDIRR", 42105.000352 },
                    { "USDISK", 119.550386 },
                    { "USDJEP", 0.756856 },
                    { "USDJMD", 124.890386 },
                    { "USDJOD", 0.70904 },
                    { "USDJPY", 109.92504 },
                    { "USDKES", 100.59504 },
                    { "USDKGS", 69.741904 },
                    { "USDKHR", 4014.503799 },
                    { "USDKMF", 435.875039 },
                    { "USDKPW", 900.082329 },
                    { "USDKRW", 1136.103792 },
                    { "USDKWD", 0.30341 },
                    { "USDKYD", 0.831765 },
                    { "USDKZT", 377.660383 },
                    { "USDLAK", 8571.650383 },
                    { "USDLBP", 1506.550382 },
                    { "USDLKR", 177.710382 },
                    { "USDLRD", 162.503775 },
                    { "USDLSL", 14.380382 },
                    { "USDLTL", 2.95274 },
                    { "USDLVL", 0.60489 },
                    { "USDLYD", 1.379104 },
                    { "USDMAD", 9.616204 },
                    { "USDMDL", 17.234039 },
                    { "USDMGA", 3547.203758 },
                    { "USDMKD", 54.091504 },
                    { "USDMMK", 1519.65038 },
                    { "USDMNT", 2616.5 },
                    { "USDMOP", 8.06705 },
                    { "USDMRO", 357.000346 },
                    { "USDMUR", 34.530379 },
                    { "USDMVR", 15.503741 },
                    { "USDMWK", 729.085039 },
                    { "USDMXN", 19.093039 },
                    { "USDMYR", 4.064504 },
                    { "USDMZN", 63.375039 },
                    { "USDNAD", 14.380377 },
                    { "USDNGN", 359.000344 },
                    { "USDNIO", 32.817504 },
                    { "USDNOK", 8.556039 },
                    { "USDNPR", 109.995039 },
                    { "USDNZD", 1.454039 },
                    { "USDOMR", 0.385039 },
                    { "USDPAB", 0.99811 },
                    { "USDPEN", 3.29025 },
                    { "USDPGK", 3.36905 },
                    { "USDPHP", 52.675039 },
                    { "USDPKR", 139.985038 },
                    { "USDPLN", 3.79235 },
                    { "USDPYG", 6135.050374 },
                    { "USDQAR", 3.641104 },
                    { "USDRON", 4.206504 },
                    { "USDRSD", 104.240373 },
                    { "USDRUB", 64.60369 },
                    { "USDRWF", 900.005 },
                    { "USDSAR", 3.750304 },
                    { "USDSBD", 8.088204 },
                    { "USDSCR", 13.648504 },
                    { "USDSDG", 47.515504 },
                    { "USDSEK", 9.277204 },
                    { "USDSGD", 1.35261 },
                    { "USDSHP", 1.320904 },
                    { "USDSLL", 8900.000339 },
                    { "USDSOS", 581.000338 },
                    { "USDSRD", 7.458038 },
                    { "USDSTD", 21050.59961 },
                    { "USDSVC", 8.733704 },
                    { "USDSYP", 515.000338 },
                    { "USDSZL", 14.360504 },
                    { "USDTHB", 31.670504 },
                    { "USDTJS", 9.42185 },
                    { "USDTMT", 3.5 },
                    { "USDTND", 3.006038 },
                    { "USDTOP", 2.25715 },
                    { "USDTRY", 5.763038 },
                    { "USDTTD", 6.778904 },
                    { "USDTWD", 30.883038 },
                    { "USDTZS", 2339.450368 },
                    { "USDUAH", 26.847038 },
                    { "USDUGX", 3695.450367 },
                    { "USDUSD", 1.0 },
                    { "USDUYU", 33.296038 },
                    { "USDUZS", 8360.750367 },
                    { "USDVEF", 9.987504 },
                    { "USDVND", 23157.1 },
                    { "USDVUV", 112.0 },
                    { "USDWST", 2.613006 },
                    { "USDXAF", 579.440365 },
                    { "USDXAG", 0.064792 },
                    { "USDXAU", 0.000761 },
                    { "USDXCD", 2.70265 },
                    { "USDXDR", 0.718551 },
                    { "USDXOF", 579.440364 },
                    { "USDXPF", 105.350364 },
                    { "USDYER", 250.350364 },
                    { "USDZAR", 14.492504 },
                    { "USDZMK", 9001.203593 },
                    { "USDZMW", 11.982037 },
                    { "USDZWL", 322.355011 }
                }
            };

            var okResult = _services.Converter(converterModelMock);

            var usd = okResult.Where(x => x.Key.Contains("USD")).FirstOrDefault();

            Assert.Equal(25.60m, usd.Value);

            Assert.IsType <Dictionary <string, decimal> >(okResult);
        }
Exemplo n.º 17
0
        public Dictionary <string, decimal> Converter(ConverterModel converterModel)
        {
            var convertedValues = new Dictionary <string, decimal>()
            {
                { "AED - United Arab Emirates Dirham", 94.05m },
                { "AFN - Afghan Afghani", 1939.07m },
                { "ALL - Albanian Lek", 2815.52m },
                { "AMD - Armenian Dram", 12399.69m },
                { "ANG - Netherlands Antillean Guilder", 46.89m },
                { "AOA - Angolan Kwanza", 8123.32m },
                { "ARS - Argentine Peso", 1048.03m },
                { "AUD - Australian Dollar", 36.13m },
                { "AWG - Aruban Florin", 46.11m },
                { "AZN - Azerbaijani Manat", 43.66m },
                { "BAM - Bosnia-Herzegovina Convertible Mark", 44.24m },
                { "BBD - Barbadian Dollar", 51.03m },
                { "BDT - Bangladeshi Taka", 2144.51m },
                { "BGN - Bulgarian Lev", 44.29m },
                { "BHD - Bahraini Dinar", 9.64m },
                { "BIF - Burundian Franc", 46156.65m },
                { "BMD - Bermudan Dollar", 25.60m },
                { "BND - Brunei Dollar", 34.54m },
                { "BOB - Bolivian Boliviano", 176.47m },
                { "BRL - Brazilian Real", 100.0m },
                { "BSD - Bahamian Dollar", 25.56m },
                { "BTC - Bitcoin", 0.01m },
                { "BTN - Bhutanese Ngultrum", 1771.41m },
                { "BWP - Botswanan Pula", 273.47m },
                { "BYN - New Belarusian Ruble", 53.97m },
                { "BYR - Belarusian Ruble", 501855.84m },
                { "BZD - Belize Dollar", 51.50m },
                { "CAD - Canadian Dollar", 34.43m },
                { "CDF - Congolese Franc", 41838.40m },
                { "CHF - Swiss Franc", 25.42m },
                { "CLF - Chilean Unit of Account (UF)", 0.64m },
                { "CLP - Chilean Peso", 17202.01m },
                { "CNY - Chinese Yuan", 172.02m },
                { "COP - Colombian Peso", 78941.16m },
                { "CRC - Costa Rican Colón", 15324.66m },
                { "CUC - Cuban Convertible Peso", 25.60m },
                { "CUP - Cuban Peso", 678.53m },
                { "CVE - Cape Verdean Escudo", 2494.10m },
                { "CZK - Czech Republic Koruna", 583.49m },
                { "DJF - Djiboutian Franc", 4550.51m },
                { "DKK - Danish Krone", 169.08m },
                { "DOP - Dominican Peso", 1297.08m },
                { "DZD - Algerian Dinar", 3047.76m },
                { "EGP - Egyptian Pound", 440.95m },
                { "ERN - Eritrean Nakfa", 384.08m },
                { "ETB - Ethiopian Birr", 729.59m },
                { "EUR - Euro", 22.62m },
                { "FJD - Fijian Dollar", 54.48m },
                { "FKP - Falkland Islands Pound", 19.46m },
                { "GBP - British Pound Sterling", 19.37m },
                { "GEL - Georgian Lari", 68.63m },
                { "GGP - Guernsey Pound", 19.38m },
                { "GHS - Ghanaian Cedi", 130.32m },
                { "GIP - Gibraltar Pound", 19.46m },
                { "GMD - Gambian Dalasi", 1272.66m },
                { "GNF - Guinean Franc", 233119.82m },
                { "GTQ - Guatemalan Quetzal", 196.27m },
                { "GYD - Guyanaese Dollar", 5333.12m },
                { "HKD - Hong Kong Dollar", 200.93m },
                { "HNL - Honduran Lempira", 624.64m },
                { "HRK - Croatian Kuna", 168.33m },
                { "HTG - Haitian Gourde", 2144.54m },
                { "HUF - Hungarian Forint", 7176.80m },
                { "IDR - Indonesian Rupiah", 366341.96m },
                { "ILS - Israeli New Sheqel", 92.73m },
                { "IMP - Manx pound", 19.38m },
                { "INR - Indian Rupee", 1771.10m },
                { "IQD - Iraqi Dinar", 30492.86m },
                { "IRR - Iranian Rial", 1078093.90m },
                { "ISK - Icelandic Króna", 3061.07m },
                { "JEP - Jersey Pound", 19.38m },
                { "JMD - Jamaican Dollar", 3197.80m },
                { "JOD - Jordanian Dinar", 18.15m },
                { "JPY - Japanese Yen", 2814.62m },
                { "KES - Kenyan Shilling", 2575.72m },
                { "KGS - Kyrgystani Som", 1785.73m },
                { "KHR - Cambodian Riel", 102790.93m },
                { "KMF - Comorian Franc", 11160.53m },
                { "KPW - North Korean Won", 23046.51m },
                { "KRW - South Korean Won", 29089.81m },
                { "KWD - Kuwaiti Dinar", 7.77m },
                { "KYD - Cayman Islands Dollar", 21.30m },
                { "KZT - Kazakhstani Tenge", 9669.95m },
                { "LAK - Laotian Kip", 219476.16m },
                { "LBP - Lebanese Pound", 38575.06m },
                { "LKR - Sri Lankan Rupee", 4550.25m },
                { "LRD - Liberian Dollar", 4160.89m },
                { "LSL - Lesotho Loti", 368.21m },
                { "LTL - Lithuanian Litas", 75.60m },
                { "LVL - Latvian Lats", 15.49m },
                { "LYD - Libyan Dinar", 35.31m },
                { "MAD - Moroccan Dirham", 246.22m },
                { "MDL - Moldovan Leu", 441.28m },
                { "MGA - Malagasy Ariary", 90825.76m },
                { "MKD - Macedonian Denar", 1385.01m },
                { "MMK - Myanma Kyat", 38910.48m },
                { "MNT - Mongolian Tugrik", 66995.19m },
                { "MOP - Macanese Pataca", 206.56m },
                { "MRO - Mauritanian Ouguiya", 9140.95m },
                { "MUR - Mauritian Rupee", 884.15m },
                { "MVR - Maldivian Rufiyaa", 396.97m },
                { "MWK - Malawian Kwacha", 18668.14m },
                { "MXN - Mexican Peso", 488.88m },
                { "MYR - Malaysian Ringgit", 104.07m },
                { "MZN - Mozambican Metical", 1622.71m },
                { "NAD - Namibian Dollar", 368.21m },
                { "NGN - Nigerian Naira", 9192.16m },
                { "NIO - Nicaraguan Córdoba", 840.29m },
                { "NOK - Norwegian Krone", 219.08m },
                { "NPR - Nepalese Rupee", 2816.41m },
                { "NZD - New Zealand Dollar", 37.23m },
                { "OMR - Omani Rial", 9.86m },
                { "PAB - Panamanian Balboa", 25.56m },
                { "PEN - Peruvian Nuevo Sol", 84.25m },
                { "PGK - Papua New Guinean Kina", 86.26m },
                { "PHP - Philippine Peso", 1348.74m },
                { "PKR - Pakistani Rupee", 3584.30m },
                { "PLN - Polish Zloty", 97.10m },
                { "PYG - Paraguayan Guarani", 157087.29m },
                { "QAR - Qatari Rial", 93.23m },
                { "RON - Romanian Leu", 107.71m },
                { "RSD - Serbian Dinar", 2669.06m },
                { "RUB - Russian Ruble", 1654.17m },
                { "RWF - Rwandan Franc", 23044.53m },
                { "SAR - Saudi Riyal", 96.03m },
                { "SBD - Solomon Islands Dollar", 207.10m },
                { "SCR - Seychellois Rupee", 349.47m },
                { "SDG - Sudanese Pound", 1216.63m },
                { "SEK - Swedish Krona", 237.54m },
                { "SGD - Singapore Dollar", 34.63m },
                { "SHP - Saint Helena Pound", 33.82m },
                { "SLL - Sierra Leonean Leone", 227883.53m },
                { "SOS - Somali Shilling", 14876.45m },
                { "SRD - Surinamese Dollar", 190.96m },
                { "STD - São Tomé and Príncipe Dobra", 538998.29m },
                { "SVC - Salvadoran Colón", 223.63m },
                { "SYP - Syrian Pound", 13186.53m },
                { "SZL - Swazi Lilangeni", 367.70m },
                { "THB - Thai Baht", 810.92m },
                { "TJS - Tajikistani Somoni", 241.25m },
                { "TMT - Turkmenistani Manat", 89.62m },
                { "TND - Tunisian Dinar", 76.97m },
                { "TOP - Tongan Paʻanga", 57.79m },
                { "TRY - Turkish Lira", 147.56m },
                { "TTD - Trinidad and Tobago Dollar", 173.57m },
                { "TWD - New Taiwan Dollar", 790.76m },
                { "TZS - Tanzanian Shilling", 59901.37m },
                { "UAH - Ukrainian Hryvnia", 687.42m },
                { "UGX - Ugandan Shilling", 94621.60m },
                { "USD - United States Dollar", 25.60m },
                { "UYU - Uruguayan Peso", 852.54m },
                { "UZS - Uzbekistan Som", 214076.09m },
                { "VEF - Venezuelan Bolívar Fuerte", 255.73m },
                { "VND - Vietnamese Dong", 592935.00m },
                { "VUV - Vanuatu Vatu", 2867.75m },
                { "WST - Samoan Tala", 66.91m },
                { "XAF - CFA Franc BEAC", 14836.51m },
                { "XAG - Silver (troy ounce)", 1.66m },
                { "XAU - Gold (troy ounce)", 0.02m },
                { "XCD - East Caribbean Dollar", 69.20m },
                { "XDR - Special Drawing Rights", 18.40m },
                { "XOF - CFA Franc BCEAO", 14836.51m },
                { "XPF - CFP Franc", 2697.48m },
                { "YER - Yemeni Rial", 6410.19m },
                { "ZAR - South African Rand", 371.08m },
                { "ZMK - Zambian Kwacha (pre-2013)", 230474.83m },
                { "ZMW - Zambian Kwacha", 306.80m },
                { "ZWL - Zimbabwean Dollar", 8253.86m }
            };

            return(convertedValues);
        }
Exemplo n.º 18
0
        public async Task <decimal> ConvertPriceAsync(ConverterModel converterModel)
        {
            var resultConverting = _currencyConverterHelper.Convert(converterModel.CurrencyFrom, converterModel.CurrencyTo, converterModel.Price);

            return(resultConverting);
        }