FacturaScripts

DivisaTools extends NumberTools

DivisaTools give us some basic and common methods for currency numbers.

Table of Contents

$selectedDivisa Divisa
__construct() DivisaTools constructor. mixed
convert() Convert the amount form currency1 to currency2. float
findDivisa() Finds a coddivisa and uses it as selected currency. mixed
format() Returns the value of the formatted currency. string
getSymbol() string
__construct() mixed
format() Returns the number format with the number of decimals indicated. string

Properties

Methods

__construct()

DivisaTools constructor.

public __construct( ) : mixed
Return values
mixed

convert()

Convert the amount form currency1 to currency2.

public static convert( $amount : float , $coddivisa1 : string , $coddivisa2 : string ) : float
Parameters
$amount : float
$coddivisa1 : string
$coddivisa2 : string
Return values
float

findDivisa()

Finds a coddivisa and uses it as selected currency.

public findDivisa( $model : object ) : mixed
Parameters
$model : object
Return values
mixed

format()

Returns the value of the formatted currency.

public static format( $number : mixed [, $decimals : mixed = FS_NF0 ] [, $decoration : string = 'symbol' ] ) : string
Parameters
$number : mixed
$decimals : mixed = FS_NF0
$decoration : string = 'symbol'
Return values
string

getSymbol()

public static getSymbol( ) : string
Return values
string

__construct()

public __construct( ) : mixed
Return values
mixed

format()

Returns the number format with the number of decimals indicated.

public static format( $number : mixed [, $decimals : mixed = \FS_NF0 ] ) : string
Parameters
$number : mixed
$decimals : mixed = \FS_NF0
Return values
string

Search results