var precision = 10000; var p1= Math.round(a.payPrice * precision); var p2= Math.round(b.payPrice * precision); return p2- p1;