Slot House Of Doom 2 By Playn Go Demo Free Play: Maar het levert zeker als het gaat om spel inhoud, toernooien en de leuke aanpak van crypto gokken.
  • Slot Pub Kings By Pragmatic Play Demo Free Play - Maar wist je dat het Was de allereerste vorm van geautoriseerde Australische gokken in de geschiedenis vanaf de 19e eeuw.
  • Stars Casino No Deposit Bonus Nederland Review: Licenties van klasse 3 worden gegeven aan de bedrijven die loterij spellen opties.
  • Baccarat spelen

    De Leukste Kaartspelletjes Om Alleen Te Spelen
    Vind je het niet leuk genoeg, dan kun je je account weer opzeggen..
    Get Lucky Casino Review Nederland
    Het biedt de spelers ook Live Casino - en Bingogames op verschillende online casinoplatforms.
    Live casino's zullen kaarten uitgeven die in slots op de machines kunnen worden geplaatst voordat u speelt.

    Online poker spelen Overijssel

    Makkelijk Geld Verdienen Roulette
    Alle spellen worden gereguleerd door de Alderney Gambling Control Commission en de UK Gambling Commission.
    Casinos Die Btc Gebruiken
    Een groot aantal casino spelers over de hele wereld zijn over te schakelen op het gebruik van cryptocurrencies zoals Bitcoin.
    Online Fruitautomaat

    Using the Google currency converter

    For a project I’m working, I needed to get shipping rates from the UPS API (a blog post about this will follow soon).

    The problem I ran into was that the UPS API returns the shipping rates with the currency of the country where the rates for are asked, so you can’t force it to always return the rates in EUR.

    One solution to convert the prices is to make a very big array with all currency rates in it. I then would maintain the array every day at 9’o clock to check if the rates weren’t changed. Right, that’s not an option.

    Like you might know you can easily convert currencies by using the Google search engine. For example searching on “1 Euro to dollar” will retrieve the Euro in dollar.

    Below the class I wrote to convert currencies using the Google currency converter.

    sConvertorUrl, $this->fPrice, $this->sFrom, $this->sTo);
    
    		$sResponse = file_get_contents($sUrl);
    		if(!$sResponse) {
    			throw new Exception('Google currency convertor is not available at the moment');
    		}
    
    		$oResult = json_decode($sResponse);
    		if($oResult->error != '') {
    			throw new Exception('The following error occurred: '.$oResult->error);
    		}
    
    		// Isolate the price
    		return (float)$oResult->rhs;
    	}
    
    	/**
    	 * Get, retrieve the foreign currency
    	 *
    	 * @param float $fPrice
    	 * @param string $sFrom, currency code (EUR, USD,...)
    	 * @param string $sTo, currency code (EUR, USD,...)
    	 */
    	public function get($fPrice, $sFrom, $sTo)
    	{
    		if(!is_float($fPrice)) {
    			throw new Exception('The price to convert should be a float, "'.gettype($fPrice). '" given while calling: '.__FUNCTION__);
    		}
    
    		$this->fPrice	= $fPrice;
    		$this->sFrom	= strtoupper($sFrom);
    		$this->sTo		= strtoupper($sTo);
    
    		return $this->exec();
    	}
    
    }
    ?>
    

    Pretty straightforward as you see.

    Leave a Comment

    Your email address will not be published. Required fields are marked *

    Scroll to Top