This project is read-only.
sortByDescending - Simple

Category:
LINQ
Description: This sample uses orderby and descending to sort a list of doubles from highest to lowest.
Code:
let LINQ21() =
let doubles = [1.7M; 2.3M; 1.9M; 4.1M; 2.9M]

query {
for d in doubles do
sortByDescending d
select d
} |> Seq.iter(fun n -> printfn "%M" n)

//sample output
// 4.1
// 2.9
// 2.3
// 1.9
// 1.7

Execution Result:
4.1
2.9
2.3
1.9
1.7

Last edited Sep 14, 2011 at 2:48 AM by ttliu2000, version 1

Comments

No comments yet.