See here for why the language does not permit conversion from real to int.
But if your data truly are binned and you’re seeking to account for that, see here.. Note that the trick I propose there should work for any center-scale distribution, but for others you’ll have to use the more manual method.