So I have just written if (@firstpage eq 0) then floor($totalPagesDecimal) else ceiling($totalPagesDecimal) but how close would (floor,ceiling)[@firstpage + 1]($totalPagesDecimal) have been I'm guessing I would at least have to put some function invoking paraphenalia around the calls to floor and ceiling (hopefully not).