Skip to content

Instantly share code, notes, and snippets.

@f13dev f13dev/eliquid.txt
Last active Apr 3, 2019

Embed
What would you like to do?
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

This comment has been minimized.

Copy link
Owner 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
You can’t perform that action at this time.