Class: CurrencyConverter

montage/core/converter/currency-converter~ CurrencyConverter

Formats a value as a currency.

Constructor

new CurrencyConverter()

Source:

Extends

Members

allowFloat :Property

Type:
  • Property
Inherited From:
Default Value:
  • {boolean} true
Source:

allowNegative :Property

Type:
  • Property
Inherited From:
Default Value:
  • {boolean} true
Source:

allowPartialConversion :Property

Allow partial conversion
Type:
  • Property
Inherited From:
Default Value:
  • {boolean} false
Source:

decimals :Property

Type:
  • Property
Inherited From:
Default Value:
  • {number} 2
Source:

forceDecimals :Property

Type:
  • Property
Inherited From:
Default Value:
  • {boolean} false
Source:

round :Property

Type:
  • Property
Inherited From:
Default Value:
  • {number} null
Source:

shorten :Property

Type:
  • Property
Inherited From:
Default Value:
  • {string} null
Source:

validator :function

Type:
  • function
Inherited From:
Default Value:
  • {attribute} NumberValidator Uses this object.
Source:

Methods

convert(value) → {string}

Parameters:
Name Type Description
value number The value to convert.
Inherited From:
Source:
Returns:
Type
string

revert(stringValue) → {number}

Parameters:
Name Type Description
stringValue string The string representation of a number.
Inherited From:
Source:
See:
Throws:
if the return value of NumberConverter#validator#validate is not a number
Type
Error
Returns:
The numeric value validated with to NumberConverter#validator.
Type
number