CurrencyConverter source

Formats a value as a currency.

Specializes NumberConverter

Properties

allowFloat :Property source

Inherited From:
Default Value:
  • {boolean} true

allowNegative :Property source

Inherited From:
Default Value:
  • {boolean} true

allowPartialConversion :Property source

Allow partial conversion

Inherited From:
Default Value:
  • {boolean} false

currency :string source

Default Value:
  • {string} '$'

decimals :number source

Default Value:
  • {number} 2

round :Property source

Inherited From:
Default Value:
  • {number} null

shorten :Property source

Inherited From:
Default Value:
  • {string} null

showCurrencyBeforeNumber :boolean source

Default Value:
  • {boolean} false

useParensForNegative :boolean source

Default Value:
  • {boolean} false

validator :Function source

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

Methods

convert(amount) → {string} source

Parameters:
Name Type Description
amount number
Returns: string

The formatted currency value.

revert(stringValue) → {number} source

Parameters:
Name Type Description
stringValue string

The string representation of a number.

Inherited From:
See:
Throws:
if the return value of NumberConverter#validator#validate is not a number
Type
Error
Returns: number

The numeric value validated with to NumberConverter#validator.

Generated from v0.14.14

Need help?

Can't find what you are looking for? Please contact us, we're more than happy to help answer your questions.