Home Manual Reference Source
private class | source

EasyCurrency

You can directly use an instance of this class. easyCurrency

Extends:

evee~Evee → EasyCurrency

Plugin for automatic currency conversion, tax handling, etc.

Constructor Summary

Public Constructor
public

This is a singleton class - do not create instances directly.

Member Summary

Private Members
private
private

_resolver: src/easycurrency/resolver.js~CurrencyResolver

private

Method Summary

Public Methods
public

addTax(amount: js-money | Number)

Adds the current tax rate to the given amount

public

convert(amount: js-money | Number, to: String, from: null | String)

Convert an amount to another currency.

public

format(amount: js-money | Number, currency: String | null)

Format a value as a currency

public

getState(): *

public

initialize(config: *)

Start running EasyCurrency on the current page.

public

Sets the active currency, and refreshs any money spans.

public

setCurrencyResolver(resolver: src/easycurrency/resolver.js~CurrencyResolver)

Overrides the default currency resolver, which provides information about the available currencies.

Public Constructors

public constructor() source

This is a singleton class - do not create instances directly.

Private Members

private _config: Config source

private _resolver: src/easycurrency/resolver.js~CurrencyResolver source

private _state: State source

Public Methods

public addTax(amount: js-money | Number) source

Adds the current tax rate to the given amount

Params:

NameTypeAttributeDescription
amount js-money | Number

public convert(amount: js-money | Number, to: String, from: null | String) source

Convert an amount to another currency.

Params:

NameTypeAttributeDescription
amount js-money | Number
to String
from null | String

Ignored if amount is a Money object.

public format(amount: js-money | Number, currency: String | null) source

Format a value as a currency

Params:

NameTypeAttributeDescription
amount js-money | Number
currency String | null

If null, uses current currency.

public getState(): * source

Return:

*

public initialize(config: *) source

Start running EasyCurrency on the current page.

Params:

NameTypeAttributeDescription
config *

public setActiveCurrency(currency: String) source

Sets the active currency, and refreshs any money spans.

Params:

NameTypeAttributeDescription
currency String

Currency code

public setCurrencyResolver(resolver: src/easycurrency/resolver.js~CurrencyResolver) source

Overrides the default currency resolver, which provides information about the available currencies.

Params:

NameTypeAttributeDescription
resolver src/easycurrency/resolver.js~CurrencyResolver