]>
git.proxmox.com Git - extjs.git/blob - extjs/build/examples/kitchensink/modern/src/view/binding/TwoWayFormulaModel.js
1 Ext
.define('KitchenSink.view.binding.TwoWayFormulaModel', {
2 extend
: 'Ext.app.ViewModel',
3 alias
: 'viewmodel.binding-twowayformula',
6 // The calls to correctFloat here are to preserve the stability
7 // of the values, we don't want precision rounding to cause the
8 // viewmodel to think the data is different.
11 return Ext
.Number
.correctFloat(get('kelvin') - 273.15);
14 this.set('kelvin', Ext
.Number
.correctFloat(v
+ 273.15));
19 return Ext
.Number
.correctFloat(get('celcius') * 1.8 + 32);
22 this.set('celcius', Ext
.Number
.correctFloat((v
- 32) / 1.8));