Convert the float to a long instead of an int, to support bigger numbers. Also round the float before casting.