Unit conversion is horribly inaccurate

Discussion in 'Recipe Editor' started by SimenK, Jan 30, 2014.

  1. SimenK

    SimenK New Member

    Joined:
    Jan 14, 2013
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    First of all, thanks for a great product!

    However, I would like to mention something which in my honest opinion is a bug.

    The unit conversion selection feature is very useful, especially for European brewers that convert American units. However, as it is, it is very inaccurate, probably from truncating the conversion result at a fixed number of digits. For example, 0.05 lb gets converted to 0 kg. Since 0.05 lb has one significant digit, it should be converted to 0.02 kg. Similarly, if the quantity to be converted was 0.050 lb (with 2 significant digits), the result should be 0.023 kg, and so on.

    The net result of the present behavior is that small batches have relatively large errors when converting units, and that conversion back and forth produces different numbers.

    For me, it is a very annoying "bug". Are there any plans of fixing this behavior?
     
  2. Ozarks Mountain Brew

    Staff Member

    Joined:
    Nov 20, 2012
    Messages:
    7,483
    Likes Received:
    3,671
    Trophy Points:
    113
    Gender:
    Male
    Occupation:
    IT Managment
    Location:
    The Ozark Mountains of Missouri
    I agree, while a great tool the rounding off bugs me in grains and hops
     
  3. Austin

    Austin Member

    Joined:
    Dec 26, 2013
    Messages:
    243
    Likes Received:
    0
    Trophy Points:
    16
    Can you give a link to exactly where this is occurring? A screen shot would be even better.

    Thanks
     
  4. SimenK

    SimenK New Member

    Joined:
    Jan 14, 2013
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    First of all, thanks to the developers for the effort they are doing.

    Let me stress that the behavior seems to indicate that it is not a fixed number of significant digits that are kept during conversion, but an absolute number of digits. Say, if 1.0e-5 kg is converted to grams, it should be 1.0e-3, keeping the same number of significant digits. However, the program truncates anything smaller than 1.0e-3 to zero (or so it seems).

    It is very easy to reproduce two cases. The first comes from switching between US and Metric, which seems to do round-off at way to few digits.

    I use Metric as default. Here is how to reproduce it, focusing on batch volumes for simplicity, but it also affects ingredients. (For example 0.02 kg converted back an forth becomes 0 kg.)

    1. Start new recipe, default settings.
    [​IMG]

    2. Change units from Metric to US.
    [​IMG]

    3. Change back, compare with original volumes.
    [​IMG]


    The second place I notice this, is when converting between units in the ingredient list internally, via the pull-down on each item. Here is the effect on fermentables:

    [​IMG]
    [​IMG]
    [​IMG]

    Admittedly, a round off occuring at a single gram is not that drastic, but in my opinion when converting from g to kg, 1 g should be 0.001 kg, not 0 kg. A more drastic effect is seen in the hop list, where g is converted to oz and back:

    [​IMG]
    [​IMG]
    [​IMG]

    These differences are quite large, especially when small batches are considered.
     
  5. Austin

    Austin Member

    Joined:
    Dec 26, 2013
    Messages:
    243
    Likes Received:
    0
    Trophy Points:
    16
    Thank you, that will help us look into the calculations.
     

Share This Page

arrow_white