THE FUNCTION WORKS! (typecast & rounding errors)