Class: FormattingMixin

XV. FormattingMixin

A mixin with functions used for formatting display data.

new FormattingMixin()

Source:

Members

formatted

An array of data types that require special formatting in displays
Source:

Methods

formatBoolean(Value) → {String}

Localize a boolean to yes/no text.
Parameters:
Name Type Description
Value Number
Source:
Returns:
Type
String

formatCost(Value) → {String}

Localize a number to cost string in the base currency.
Parameters:
Name Type Description
Value Number
Source:
Returns:
Type
String

formatDate(Date) → {String}

Localize a date.
Parameters:
Name Type Description
Date Date
Source:
Returns:
Type
String

formatDueDate(Date, View, Model) → {String}

Localize a date and add the class for `error` to the view if the date is before today.
Parameters:
Name Type Description
Date Date
View Object
Model Object
Source:
Returns:
Type
String

formatExtendedPrice(Value) → {String}

Localize a number to an extended price string in the base currency.
Parameters:
Name Type Description
Value Number
Source:
Returns:
Type
String

formatHours(Value) → {String}

Localize a number to an hours string in the base currency.
Parameters:
Name Type Description
Value Number
Source:
Returns:
Type
String

formatMoney(Value) → {String}

Localize a number to a currency string using the base currency.
Parameters:
Name Type Description
Value Number
Source:
Returns:
Type
String

formatPercent(Value) → {String}

Localize a number to a percent string.
Parameters:
Name Type Description
Value Number
Source:
Returns:
Type
String

formatPurchasePrice(Value) → {String}

Localize a number to a purchase price string in the base currency.
Parameters:
Name Type Description
Value Number
Source:
Returns:
Type
String

formatQuantity(Value) → {String}

Localize a number to a quantity string.
Parameters:
Name Type Description
Value Number
Source:
Returns:
Type
String

formatQuantityPer(Value) → {String}

Localize a number to a quantity string.
Parameters:
Name Type Description
Value Number
Source:
Returns:
Type
String

formatSalesPrice(Value) → {String}

Localize a number to an sales price string in the base currency.
Parameters:
Name Type Description
Value Number
Source:
Returns:
Type
String

formatUnitRatio(Value) → {String}

Localize a number to a unit ratio string.
Parameters:
Name Type Description
Value Number
Source:
Returns:
Type
String

formatWeight(Value) → {String}

Localize a number to a weight string.
Parameters:
Name Type Description
Value Number
Source:
Returns:
Type
String