partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

CurrencyNumberField.js (851B)


      1 /**
      2  * Extends the Ext.ux.NumericField and applies defaults stored within the user preferences.
      3  */
      4 Ext.define("PartKeepr.CurrencyField", {
      5 	extend: "Ext.ux.NumericField",
      6     alias: 'widget.CurrencyField',
      7     
      8     initComponent: function () {
      9     	this.decimalPrecision 	= PartKeepr.getApplication().getUserPreference("partkeepr.formatting.currency.numdecimals", 2);
     10     	this.currencySign 		= "";
     11     	this.currencyAtEnd		= PartKeepr.getApplication().getUserPreference("partkeepr.formatting.currency.currencySymbolAtEnd", true);
     12     	
     13     	if (PartKeepr.getApplication().getUserPreference("partkeepr.formatting.currency.thousandsSeparator", true) === true) {
     14     		// @todo This is hard-coded for now
     15     		this.thousandSeparator 	= ",";
     16     	} else {
     17     		this.thousandSeparator 	= "";
     18     	}
     19     	 
     20     	
     21     	
     22     	this.callParent();
     23     }
     24 });