You'll generally get better prices (and often better timber) from a timber merchant than from the DIY sheds. And your timber merchant will stock longer lengths (my favourite place defaults to 4800 but usually has some 5400 as well). Generally the price is by the linear metre or cubic metre (so doesn't matter what lengths you order). Again your timber merchant will be able to take the room dimensions and tell you how many linear metres you need but it is worth knowing the joist centres- can make a difference to what lengths will give minimum wastage