Here's a cheap little algorithm that will do it. Just compare the number to its value when rounded to an integer and add either 0 or 0.5 accordingly to the integral value. This is written in LabVIEW 7.0, let me know if you need it in an earlier version.
Jarrod S.
National Instruments