Mobile Framework

Currency and Units Formatting

Available functionality supports currency and area and length formatting in forms and views.

The currency symbol displayed is determined by the BudgetCurrency field in the afm_activity_params table.

The area and length units value is determined by the values of units and base_metric_units in the afm_scmpref table. When the unit setting is imperial the area and length values are sq. ft. and ft.

When the unit setting is metric the area and length values are determined by the base_metric_units value.

Format functions:

Ext.util.Format.currency – displays the number value with the currency symbol added

Ext.util.Format.area – displays the number value with the sq. ft. or sq. m added

Ext.util.Format.length – displays the number value with the ft. or m added

Format functions can be used in any template function.

Example : Formatting a number as currency in a list

{
xtype: 'list',
store: 'workRequestCostsStore',
flex: 1,
itemTpl: '<div>Type: {other_rs_type}<div><div>Cost: {cost_total:currency(2)}</div>'
}

The Common.control.field.Number class can display the currency, area, or length description in the label using the labelFormat property.

Example: Display the currency symbol in a form field.

{
xtype : 'formattednumberfield',
label : 'Actual Cost',
name : 'cost_total',
labelFormat: 'currency'
}