Home Manual Reference Source Repository
public class | source

DefaultFormatter

Extends:

Formatter → DefaultFormatter

A default formatting implementation. Formats most currencies as $00.00, except JPY which is 00 $

Method Summary

Public Methods
public

format(amount: type, currency: type): String

Format a currency.

Private Methods
private

_formatPrefixedSymbolTwoDecimal(amount: Number, currencyInfo: Object, space: Boolean): String

Format as $00.00

private

_suffixSymbolNoDecimal(amount: Number, currencyInfo: Object, space: Boolean): String

Format as 00 $

Inherited Summary

From class Formatter
public

format(amount: type, currency: type): String

Format a currency.

Public Methods

public format(amount: type, currency: type): String source

Format a currency.

Override:

Formatter#format

Params:

NameTypeAttributeDescription
amount type

Amount in cents.

currency type

Currency code to convert to.

Return:

String

Private Methods

private _formatPrefixedSymbolTwoDecimal(amount: Number, currencyInfo: Object, space: Boolean): String source

Format as $00.00

Params:

NameTypeAttributeDescription
amount Number
currencyInfo Object
space Boolean

Return:

String

private _suffixSymbolNoDecimal(amount: Number, currencyInfo: Object, space: Boolean): String source

Format as 00 $

Params:

NameTypeAttributeDescription
amount Number
currencyInfo Object
space Boolean

Return:

String