Jump to content
Coopers Community

ABV calculator code here


AdamG2

Recommended Posts

Hello everyone,

 

I am new to the home brew scene and I noticed that some people have asked for a ABV calculator so I thought I would write you one.

 

simply copy the following code and open notepad.

 

Then save as ABV.vbs

 

Remember to change the type from .txt to All files (*.*)

 

Dim OG
Dim FG
Dim sum

OG = InputBox("Enter the orignal gravity (OG)", "Adam's homebrew alcohol calculator")
FG = InputBox("Enter the final gravity (FG)", "Adam's homebrew alcohol calculator")

If IsNumeric(OG) And IsNumeric(FG) Then
sum = OG - FG 

Wscript.Echo "Your home brew's ABV is " & FormatNumber(sum / 7.46 + 0.5, 2),"%"

Else
   Wscript.Echo "Both values must be numeric. OG = " & OG & " and FG = " & FG
End If

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...