Skip to content

Instantly share code, notes, and snippets.

@f13dev
Last active April 3, 2019 08:28
Show Gist options
  • Save f13dev/b56a40553f670ffc3c521c07f47637b2 to your computer and use it in GitHub Desktop.
Save f13dev/b56a40553f670ffc3c521c07f47637b2 to your computer and use it in GitHub Desktop.
HP 39/40 Eliquid mixing calculator. Copy this code to a new program in your calculator and then when ran you are asked to enter: A VG ratio, A concentrate nicotine strength, A desired nicotine strength, A flavour percentage and the quantity to make. You will be presented with the required quantities. This assumes that your flavour and nicotine i…
EXPORT ELIQUID()
BEGIN
LOCAL DP = 2)
INPUT(V,"VG percentage");
INPUT(N,"Concentrate nicotine mg/ml");
INPUT(D,"Desired nicotine mg/ml");
INPUT(F,"Flavour percentage");
INPUT(M,"Quantity to make (ml)");
PRINT();
LOCAL VGML = V/100*M;
Local NICML = (D/N)*M;
LOCAL FLAVML = F/100*M;
LOCAL PGML = M-VGML-NICML-FLAVML-PGML;
LOCAL PGR = 100-V;
PRINT(M + "ml, VG" + V + "/" + PGR + "PG, " + D + "mg/ml, " + F + "%";
PRINT("");
PRINT("VG: " + ROUND(VGML,DP) + "ml");
PRINT("PG: " + ROUND(PGML,DP) + "ml");
PRINT("Flavour: " + ROUND(FLAVML,DP) + "ml");
PRINT("Nicotine: " + ROUND(NICML,DP) + "ml");
END;
@f13dev
Copy link
Author

f13dev commented Apr 3, 2019

Screenshot of results:
calc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment