Skip to content

Instantly share code, notes, and snippets.

@flpms
Created February 16, 2016 00:30
Show Gist options
  • Select an option

  • Save flpms/5baff7b6f55a1cdf25c9 to your computer and use it in GitHub Desktop.

Select an option

Save flpms/5baff7b6f55a1cdf25c9 to your computer and use it in GitHub Desktop.
var fatorDesq;
var rs = this.getField("rs").value;
var rt = this.getField("rt").value;
var st = this.getField("st").value;
var valores = [rs, rt, st];
valores.sort(function(maior, menor) {
if (maior > menor) return -1;
if (maior < menor) return 1;
if (maior === menor) return 0;
});
fatorDesq = valores[0] - valores[valores.length -1] ;
this.getField('fatorDesq');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment