Does this work?  

Seems like if you have a float value and the user is requesting an integer/long we should just throw an exception (or return null and log the warning).