• Welcome to the new forum! We upgraded our forum software with a host of new boards, capabilities and features. It is also more secure.
    Jump in and join the conversation! You can learn more about the upgrade and new features here.

Ingredient amount changes when exporting as BeerXML

Atron Seige

New Forum Member
Joined
Sep 15, 2013
Messages
3
Reaction score
1
Location
New Zealand
Good Morning.

I noticed that when I export a recipe as BeerXML, some of the values will change a *very* small amount, but the visual effect is quite jarring. In the attached example, Marris Otter is 2.500 kgs, but in the XML is is 2.4999984. I know that this is a *very* small change, but it suddenly looks like a really big number :)

Why am I exporting to BeerXML? So that I can import the recipe into the Grainfather app. At time of writing I have not been able to get BeerSmithXML files to succsessfully import, so I am using BeerXML.

The attached zip contains the PDF and the BeerXML files.

Thank you, and a Happy Brew Year! :D
 

Attachments

  • Unremarkable.zip
    476.3 KB · Views: 1
What you are looking at is rounding. While the number looks big, it is actually a very small percentage change. In the recipe, you can set the number of decimal places which are shown for the ingredients. This then rounds the number to, in this case, the nearest hundredth.

The XML file contains the calculated figure to the extent the XML formatting allows
 
Yes - not surprisingly the numbers are stored as regular double floating point values so there is some rounding. Also internally they are stored in English units so there is some rounding that also takes place in converting between metric/english.
 
I guessed it was a convestion thing but I was not aware that BeerSmith uses English units as the default.

Thank you for the feedback.

Would it be possible to have the export apply the user's Precision Preferences in a future version?

Have a great day!
 
Those are American units BTW, not English. The English switched to metric about 60 years ago. :)
 
The precision is limited by any floating point representation. This is (unfortunately) a feature of digital computers and how they represent floating point. The conversions add additional error as they are not exact numbers either.

I will make a note to review the unit conversions used as they probably could be done with additional precision to give better numbers.
 
Back
Top