Fuelly Forums

Fuelly Forums (https://www.fuelly.com/forums/)
-   Fuelly Web Support and Community News (https://www.fuelly.com/forums/f2/)
-   -   Rounding errors (https://www.fuelly.com/forums/f2/rounding-errors-712.html)

mrtickle 11-17-2010 07:54 PM

Rounding errors
 
I've imported my data on both the car's I've owned. I am proud to tell you that I have recorded every fuel filling I've ever done in my life. I think this is just the site for me!

However there are rounding errors. These are present when I export the data. Eg I import a filling of 37.000 litres, but it appears in "Basic stats" as 36.999 litres. It appears in the full log as "37.0" litres. If I Export the data, it comes out as 36.999 litres. :-(

Is it being stored in a table without enough precision, and/or is there a set of unnecessary conversion to gallons and back? If so please can this be set more accurately?

Even if I edit the fuelup and set it to 37.000, it immediately gets set back to 36.999.

pb 11-18-2010 01:01 AM

You're right, Fuelly stores everything in US units. We do this so we can convert between US, Metric, and UK units for display. One side-effect of conversion is that we lose precision in exactly this way.

Changing this around would mean a complete rewrite of the system, and we're not willing to do that. If you report your fuel-ups in litres or kilometers and you need absolute precision I'm afraid Fuelly isn't going to work for you. You'll need to find a system that stores data in litres and kilometers.

mrtickle 11-18-2010 03:16 AM

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. :-)

pb 11-18-2010 03:40 AM

huh, hadn't considered that as a fix. I'll do some testing and see if I get similar results with our database.


All times are GMT -8. The time now is 08:08 PM.

Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.