How to get amount in RPC
The amounts returned by Bitcoin Core are accurate. They are not actually doubles; they're just output that way for convenience. Bitcoin Core internally uses a int64 and the amounts are satoshis. When outputting for users, the int64 is used and a string formatter just puts a decimal point in the appropriate place. Since it already is exact, you just need to drop the decimal point. The easiest way to do this is to take the output as a string, remove the decimal point, and convert that string to an integer.