Fair enough. I completely understand why you did that and didn't mean to tread on any toes. Obviously asking to completely rewrite the system isn't reasonable of me and I wouldn't do that, especially on my first day :-)
Having thought about it more, I think that storing the converted US gallons value with a bit more precision - even just 1 or 2 more decimal places - might do the trick. Doing a test in Excel with the "precision as displayed" option turned on you can test converting from litres to US gallons and then back to litres, and then a separate "rounded to 3dp" copy of the litres output value. You can see the effect it has when changing the number of decimal places used to store the US gallons value.
When I use 3dp to store the US gallons value I get the .999 behaviour for the litres output, but with 4dp it seems to be ok! Even though the raw converted litres value isn't bang on, this doesn't really matter because when it is rounded to 3dp as it would be for display, it matches the original value.
something like...
conv factor=3.785411784
input litres=38
US gallons stored to 4dp=10.0385
output litres=37.9998562
display litres (3dp)=38.000
Again, I apologise in advance if this is asking too much but it might turn out to be possible to get the litres display correct with small changes. :-)
|