That's for floats. There's nothing wrong with the function itself (although it can be written shorter, see below) so you probably placed it in the wrong spot.
That's for floats. There's nothing wrong with the function itself (although it can be written shorter, see below) so you probably placed it in the wrong spot.