Ain't floating point math great?
I just ran into this and used NumberFormat to solve this (another advantage in my case was that I got a
String, which is what I utimately needed). You can set the min and max number of decimal spaces. May not be the best way, but it works.