Class Socialveo\Core\helpers\CurrencyHelper

InheritanceSocialveo\Core\helpers\CurrencyHelper

Class CurrencyHelper

Public Methods

Hide inherited methods

MethodDescriptionDefined By
convertFromUSD() Convert currency Socialveo\Core\helpers\CurrencyHelper
convertToMinimalUnit() Convert amount to minimal unit. Socialveo\Core\helpers\CurrencyHelper
getConfig() Get config of the currency Socialveo\Core\helpers\CurrencyHelper
round() Round amount using currency config Socialveo\Core\helpers\CurrencyHelper

Constants

Hide inherited constants

ConstantValueDescriptionDefined By
CURRENCY_CODE 'code' Socialveo\Core\helpers\CurrencyHelper
CURRENCY_DECIMALS 'decimals' Socialveo\Core\helpers\CurrencyHelper
CURRENCY_DESCRIPTION 'description' Socialveo\Core\helpers\CurrencyHelper
CURRENCY_NAME 'name' Socialveo\Core\helpers\CurrencyHelper
CURRENCY_RATE 'rate' Socialveo\Core\helpers\CurrencyHelper
CURRENCY_SYMBOL 'symbol' Socialveo\Core\helpers\CurrencyHelper

Method Details

convertFromUSD() public static method

Convert currency

public static float|integer convertFromUSD ( $amountUSD, $toCurrency )
$amountUSD float|integer
$toCurrency string
convertToMinimalUnit() public static method

Convert amount to minimal unit.

e.g. $10.05 => ยข1005

  echo CurrencyHelper::convertToMinimalUnit(10.05, 'USD'); // 1005

public static integer convertToMinimalUnit ( $amount, $currency )
$amount float|integer
$currency string
throws Exception
getConfig() public static method

Get config of the currency

public static array|mixed getConfig ( $currency null )
$currency string

[optional]

throws Exception
round() public static method

Round amount using currency config

public static float|integer round ( $amount, $currency )
$amount float|integer
$currency string
throws Exception