Inventory rounding to 3 decimal points

Discussion in 'Feature Requests' started by panajana, Aug 28, 2020.

  1. panajana

    panajana New Member

    Joined:
    Sep 2, 2018
    Messages:
    4
    Likes Received:
    3
    Trophy Points:
    3
    I prefer to use kilograms as a unit for my items. I noticed that subtractions from inventory are wrong in brew sessions due to the rounding to 2 decimal places. Although my items are in kg, in the recipe I often use smaller quantities. I'll give an example:
    The inventory says I have 0.08 kg of Citra.
    I use 25g of Citra in my recipe.
    When I want to brew my recipe, it shows me that after subtraction I'll have 0.05 kg of Citra.
    The correct amount would be 0.055 kg, which is not displayed because only 2 decimal places are used.

    When I lose 5g here and there, it can add up very quickly to a considerable amount. I think it makes sense to use as many decimal places as you need to convert the largest unit to the smallest unit. In this case, 1 kg is 0.001 g, therefore we need 3 decimal places.

    I understand you can tell me to stick to grams for everything, but I usually buy from places that have a price for kilograms and I don't want to deal with small amounts of money in the inventory.
    I have no idea what you use to store your data, but adding one more decimal places in the database shouldn't be too problematic.
    Thanks for considering this even though it's probably not a priority.
     
  2. Pricelessbrewing

    Pricelessbrewing QA Software Tester
    Staff Member

    Joined:
    Jun 8, 2016
    Messages:
    766
    Likes Received:
    502
    Trophy Points:
    93
    Gender:
    Male
    I'll put in a ticket.

    Inventory subtractions should not be rounded at all, you should be removing the exact amount in the recipe.
     
    Chaos home brewing and Craigerrr like this.
  3. Mark Farrall

    Mark Farrall Well-Known Member

    Joined:
    Oct 19, 2017
    Messages:
    1,303
    Likes Received:
    1,423
    Trophy Points:
    113
    Location:
    Melbourne Australia
    #3 Mark Farrall, Aug 29, 2020
    Last edited: Aug 29, 2020
    Can we also have rounding litres to the nearest 100 mL? Rounding to the 10 mL is a level or precision no one ever needs. Probably just a hangover from the same level of rounding for gallons.

    For a bit more background, if I have a 12 litre batch size and I hit the calc button to update the boil volume the new batch size will be 12.01 or 11.99. Looks like some conversion to gallons and back and the rounding to two points gives the annoying new batch size.
     
    Chaos home brewing likes this.
  4. Pricelessbrewing

    Pricelessbrewing QA Software Tester
    Staff Member

    Joined:
    Jun 8, 2016
    Messages:
    766
    Likes Received:
    502
    Trophy Points:
    93
    Gender:
    Male
    D1028_82_098_1200.jpg

    You mean this isn't you on brewday? I'll add this to an open ticket for unit conversion
     
    Chaos home brewing likes this.
  5. Mark Farrall

    Mark Farrall Well-Known Member

    Joined:
    Oct 19, 2017
    Messages:
    1,303
    Likes Received:
    1,423
    Trophy Points:
    113
    Location:
    Melbourne Australia
    A bit more precision would certainly help my brewday...
     
  6. Nosybear

    Nosybear Well-Known Member

    Joined:
    Jul 16, 2012
    Messages:
    9,400
    Likes Received:
    6,643
    Trophy Points:
    113
    Location:
    Aurora, CO, USA
    Dang it, I resemble that remark!
     
  7. panajana

    panajana New Member

    Joined:
    Sep 2, 2018
    Messages:
    4
    Likes Received:
    3
    Trophy Points:
    3
    Thanks for looking into this :)
     
  8. Yooper

    Yooper Administrator
    Staff Member

    Joined:
    Nov 16, 2013
    Messages:
    2,491
    Likes Received:
    1,580
    Trophy Points:
    113
    Gender:
    Female
    Occupation:
    Happily retired
    Location:
    Upper Michigan/Florida
    My only concern is that I use a lot of grams/ounces. When I convert, I sure don't want 2.586 grams of something! I'm good with 2.5 or 2.6 if it must round.
     
    Mark Farrall likes this.
  9. Mark Farrall

    Mark Farrall Well-Known Member

    Joined:
    Oct 19, 2017
    Messages:
    1,303
    Likes Received:
    1,423
    Trophy Points:
    113
    Location:
    Melbourne Australia
    Rethinking after Yooper's comment..

    Unless this is something added as a user preference I don't see rounding to three decimal places on kilos making sense. For me it'd be better to choose grams as the recipe unit.

    Some of this depends on whether the original entry is being preserved in the code or whether it's being stored in US imperial and then converted to metric for users with that preference. If it's the conversion approach then if I put in 3 kilos of pilsner I'm going to end up with 2.998 or 3.002 kilos whenever the recipe is updated. If the original entry is preserved in whatever scale it was entered I'm not too fussed.

    Personally I prefer just one decimal point for any single or greater unit (so gram, kilogram or higher) and no rounding for smaller than the unit (so milligram, microgram etc.)
     
    Yooper likes this.
  10. Pricelessbrewing

    Pricelessbrewing QA Software Tester
    Staff Member

    Joined:
    Jun 8, 2016
    Messages:
    766
    Likes Received:
    502
    Trophy Points:
    93
    Gender:
    Male
    In this case, the exact value should be stored, inventory shouldn't be rounded internally, whether that amount is displayed as 3 Kg, or 3.002 kg is a different matter.

    But if you buy a new bag of hops, let's say it's 1K, and you brew a recipe and use 25grams of it. Right now your new inventory is 0.97 KG, do that a couple times and your inventory gets out of whack. Precision matters for inventory.

    If this works out the way it should, your inventory should be 975 grams. Whether that's displayed as 0.975 kg, or 0.98 kg due to rounding, is a different question IMO.
     
    Mark Farrall likes this.

Share This Page

arrow_white