Hi folk, I have
u16 wTemp = 0; fsingle fTemp = 17.5123; wTemp = (u16)fTemp;
I've always performed my rounding explicitly. For your example I would code it thusly:
u16 wTemp = 0; fsingle fTemp = 17.5123; wTemp = (u16)(fTemp + 0.5);