Function __global->currency_convert_wrap

Definitions

sources/currency.php

  • Perform a currency conversion to the visitor's currency, if automatic conversions are enabled -- otherwise just display in the site currency.Not cache safe.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No

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 Null N/A N/A The start currency code (null: site currency)
$display_method integer No No 6 N/A N/A A CURRENCY_DISPLAY_* constant

Returns

  • The new amount with the specified display method (CURRENCY_DISPLAY_RAW is a float, otherwise a string) (null: error)
  • Type: ?mixed
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Perform a currency conversion to the visitor's currency, if automatic conversions are enabled -- otherwise just display in the site currency.Not cache safe.
 *
 * @param  mixed $amount The starting amount (integer or float)
 * @param  ?ID_TEXT $from_currency The start currency code (null: site currency)
 * @param  integer $display_method A CURRENCY_DISPLAY_* constant
 * @return ?mixed The new amount with the specified display method (CURRENCY_DISPLAY_RAW is a float, otherwise a string) (null: error)
 */

function currency_convert_wrap($amount, ?string $from_currency = null, int $display_method = 6)