MC-XOBAHCK,
<script>
var ostatki = [170,170,170,170,170,890,130,130,130,260], out = {};
ostatki.forEach(function(a) {
out[a] = (out[a]||0)+1
});
out = Object.keys(out).sort(function(a,b) {
return a - b
}).map(function(a) {
return a+'мм - ' + out[a] +' штук'
})
document.write(JSON.stringify(out, null, 4))
</script>