Function __global->_currency_convert__currency_conv_api

Definitions

sources/currency.php

  • Perform a currency conversion using "The Free Currency Converter API".
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: float

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$amount mixed No No required parameter N/A N/A The starting amount (integer or float)
$from_currency ID_TEXT No No required parameter N/A N/A The start currency code
$to_currency ID_TEXT No No required parameter N/A N/A The end currency code

Returns

  • The new amount (null: could not look up)
  • Type: ?float
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Perform a currency conversion using "The Free Currency Converter API".
 *
 * @param  mixed $amount The starting amount (integer or float)
 * @param  ID_TEXT $from_currency The start currency code
 * @param  ID_TEXT $to_currency The end currency code
 * @return ?float The new amount (null: could not look up)
 */

function _currency_convert__currency_conv_api($amount, string $from_currency, string $to_currency) : ?float