currency not parsed!! // return default value return 0 Node.SelectSingleNode( "//cb:statistics//cb:exchangeRate//cb:value", nsmgr).InnerText, Get currency exchange rate with EURO from XMLNODE float exchangeRate = float.Parse( )ĬultureInfo ci = (CultureInfo)() Ĭi.NumberFormat.CurrencyDecimalSeparator = "." ![]() Create a CultureInfo, this is because EU and USA use different sepperators in float (, or. Loop Through all XMLNODES with daily exchange rates foreach ( node in nodeList) nodeList = doc.SelectNodes( "//rdf:item", nsmgr) Get list of daily currency exchange rate between selected "currency" and the EURO Create XmlNamespaceManager for handling XML namespaces. Create with currency parameter, a valid RSS url to ECB euro exchange rate feed string rssUrl = string.Concat( "", currency.ToLower() + ".html") Throw new ArgumentException( "Invalid Argument! Cannot get exchange rate from EURO to EURO") Throw new ArgumentException( "Invalid Argument! currency parameter cannot be empty!") ![]() / /// Get currency exchange rate in euro's /// public static float GetCurrencyRateInEuro( string currency) Hardcoded currency tags neccesairy to parse the ecb xml's return new string / /// Gets all available currency tags /// public static string GetCurrencyTags( )
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |