Hmm, I'm kinda suprised that gasoline and diesel are so much different.
Just to add another wrinkle, temperature will change the volume of your tank as well, i.e. if the temperature is higher the tank volume will be larger because the tank material has expanded slightly. Of course, as you fill the tank up the tank material will be cooled or warmed by the fuel. And all this depends on the tank material and tank shape as well.
It's interesting how complicated "simple" things like filling up can be isn't it