3
I’m ordering a related json into notes in undescore.js
{8.0 , 8,5 , 5,5 }
var asc = _.sortBy(oper, function(num) {
return num.nota;
});
Punch the 10.0 he doesn’t throw up.. He gets like this
8.8
6.0
5.5
10.0
0.0
How do I make him understand this?
this json is badly formatted, which is the
oper
? makes it clear?– Sergio
Those notes are in string format, right? ('cause
10.0
>5.5
, but"10.0" < "5.5"
) Anyway, I do not understand why he is ordering in descending order instead of increasing, by the code shown should not give this result, whatever the type. Could give more details, for example a more complete code snippet?– mgibsonbr
Oper is json {note:8.0 , note:8.5 , note:5.5 } the notes are in json
– raddx
correct mgibsonbr! is just add parseFloat() that resolvel, put as an answer for me to give as solved, thank you!
– raddx