BLCC - Base Liquid Cost Calculator

Status
Not open for further replies.

Kable

Ultra Member
ECF Veteran
Verified Member
Nov 29, 2012
1,134
1,538
Davis, CA
I feel it's time for a small update on how things are going. So far on the test-site the design and error-checking for the flavouring part is finished.

Next up is to include the flavourings into the calculation mix, which is what I've been dreading the most. :unsure:

Take percent of flavoring in mix converted to decimal, multiply by total size of mix divided by size of flavoring bottle, multiply result by cost of flavoring bottle and add to cost calculations.

something like: cost = percent_flavor * (1 / 100) * (mix_size / flavor_size) * flavor_cost + cost > assuming cost is a variable name where you stored the cost calculation for the base earlier in the code, and you'll have to do this for each flavoring in the mix

I'm not sure if that helps at all.
 
Last edited:

johndoe1027

Senior Member
ECF Veteran
Verified Member
Sep 18, 2014
250
126
NC, USA
I feel it's time for a small update on how things are going. So far on the test-site the design and error-checking for the flavouring part is finished.

Next up is to include the flavourings into the calculation mix, which is what I've been dreading the most. :unsure:

I, for one, appreciate all of the hard work you're putting into this. THANK YOU!

I'm waiting on a shipment of VG, PG, nic and flavors atm and, one those are in hand, I look forward to using your site to figure out how much my juices cost.
 

solkku

Full Member
Sep 28, 2014
40
36
Helsinki, FI
Take percent of flavoring in mix converted to decimal, multiply by total size of mix divided by size of flavoring bottle, multiply result by cost of flavoring bottle and add to cost calculations.

something like: cost = percent_flavor * (1 / 100) * (mix_size / flavor_size) * flavor_cost + cost > assuming cost is a variable name where you stored the cost calculation for the base earlier in the code, and you'll have to do this for each flavoring in the mix

I'm not sure if that helps at all.

Yeah, I think this is somewhat how I have it in the other calculator. Thanks man, I will refer to this if I stumble upon problems. :toast:
 

solkku

Full Member
Sep 28, 2014
40
36
Helsinki, FI
Things are progressing and I wanted to share you all a sneak peek. ;)

The calculator now knows how much the flavouring costs / ml, how much it costs in different amounts of target liquids (depending on dilute %) and also how much flavouring (ml) is needed for said target liquids. All of these prices currently support different currencies as well. ;)

Tomorrow I need to start calculating the effects in VG/PG amounts in the target liquid, depending on if the flavouring is VG or PG based. And then I'm ready to start outputting some result tables.

The calculator will support five flavourings, that should be enough for most of us, I think.

Good night! :vapor:
 

Attachments

  • sneakpeek.jpg
    sneakpeek.jpg
    18.6 KB · Views: 24
Last edited:

bwh79

Vaping Master
ECF Veteran
Verified Member
Dec 11, 2014
4,600
6,644
46
Oregon
It currently supports only €, $ and £. If you want your local currency supported, please give me a shout.

Why even use currencies at all?

If the materials cost ten USD and it makes 100ml of e-liquid, then the cost is 0.10 USD per ml.
If the materials cost ten Euros and it makes 100ml of e-liquid, then the cost is 0.10 Euro per ml.
If the materials cost ten Zimbabwean dollars and it makes 100ml of e-liquid, then the cost is 0.10 Zimbabwean dollars per ml.
If the materials cost ten "Neptunian Dingleberries," and it makes 100ml of e-liquid, then the cost is 0.10 Neptunian Dingleberries per ml.
If the materials cost ten chickens, and it makes 100ml of e-liquid, then the cost is 0.10 chickens per ml.

If the materials cost ten of anything, and it makes 100ml of e-liquid, then the cost is still 0.10 "somethings" per ml. It doesn't matter what those "somethings" are; just let them enter "10," and have it spit out a figure of "0.10 per ml." Who cares if they're using dollars, cents, chickens, Neptunian Dingleberries, or anything else? The math is the same, any way you slice it.
 
Last edited:

solkku

Full Member
Sep 28, 2014
40
36
Helsinki, FI
bwh79, what if two of the materials cost 10 chickens and one of the materials cost 10 Neptunian Dingleberries. How many cows is 0.10ml of that? ;)

See, like I said in a post before, not all of us are fortunate enough to buy all of our bases and flavourings within the borders of our country, with our own currency.
 
Last edited:

Kable

Ultra Member
ECF Veteran
Verified Member
Nov 29, 2012
1,134
1,538
Davis, CA
The exchange rate for Neptunian Dingleberries is really high because of transportation costs, so it'd be a lot of cows. Much better to buy things in Lunar or Martian Dingleberries, but that's not important right now. *waves hand* These are not the droids you're looking for.

solkku, you're doing all this work and it seems like you know perfectly well what you're doing. Don't mind all us back seat drivers. Thank you for your hard work and patience.
 

dannyv45

ECF DIY E-Liquid Guru
ECF Veteran
Verified Member
Apr 12, 2013
7,739
8,424
New Jersey
www.e-cigarette-forum.com
The calculator will support five flavourings, that should be enough for most of us, I think.

Good night! :vapor:

5 flavors are OK as a start but considering that a lot of us work with additives, flavor molecules and several accent or note flavors. Some of our recipes can contain 7 or more flavor components. E-Juice me up calculator just up'ed there flavor calculations field to 10 entries.
 
Last edited:

solkku

Full Member
Sep 28, 2014
40
36
Helsinki, FI
5 flavors are OK as a start but considering that a lot of us work with additives, flavor molecules and several accent or note flavors. Some of our recipes can contain 7 or more flavor components. E-Juice me up calculator just up'ed there flavor calculations field to 10 entries.

Thank you dannyv45 for this info, I did not know that. Once I get these five working it'll be easy to increase the amount of flavouring to ten or even more if needed. ;)
 

bwh79

Vaping Master
ECF Veteran
Verified Member
Dec 11, 2014
4,600
6,644
46
Oregon
bwh79, what if two of the materials cost 10 chickens and one of the materials cost 10 Neptunian Dingleberries. How many cows is 0.10ml of that? ;)

See, like I said in a post before, not all of us are fortunate enough to buy all of our bases and flavourings within the borders of our country, with our own currency.

I guess that could be an issue. So, your program is doing the conversions on the fly, then?
 

solkku

Full Member
Sep 28, 2014
40
36
Helsinki, FI
I guess that could be an issue. So, your program is doing the conversions on the fly, then?

Yes, using a currency conversion API. Google's conversion API stopped working sometime last year, so I had to find an alternative one. But this one gives the same results as Google does (I tested it manually with several currencies). ;)
 

solkku

Full Member
Sep 28, 2014
40
36
Helsinki, FI
The flavouring part is now online guys and the calculator version updated to v1.1! ;)

I've done extensive testing and didn't find any bugs, so please give it a go. If you suspect something is wonky, just tell me and I'll look into it.

Like I said, the flavourings are currently restricted to 5, but reading dannyv45's suggestion I'll increase them to 10 in the next few days.

Now it's time to relax and play some BF4. :toast:

Edit: I currently have it so that it empties out the flavouring fields when you uncheck the "Add flavouriongs". Do you think this is ok or should the amounts be remembered when you re-check "Add flavouriongs"? I could add an icon to reset all fields within a flavouring also.
 
Last edited:

Kable

Ultra Member
ECF Veteran
Verified Member
Nov 29, 2012
1,134
1,538
Davis, CA
It works for me. Remembering the states when flavoring is unchecked may be useful for some people I suppose. Using a reset button is a more intuitive way to clear the fields too, but I don't think anyone would have trouble figuring it out this way. So I would say making the changes you mentioned would be good, increasing the flavor fields is probably a higher priority for people who will be using this I would guess.
 

solkku

Full Member
Sep 28, 2014
40
36
Helsinki, FI
Thanks Kable again! I think I'll implement a way to reset the fields of individual flavourings tomorrow. I can see a situation where someone wants to calculate the cost of their base with the flavourings and then just uncheck the "Add flavourings" again and see how that affects the cost, and vice versa.

After implementing that, I think we'll need a "Reset all flavourings fields" button. :D Nothing is more frustrating than emptying out 20 fields of text by hand. :mad:
 

solkku

Full Member
Sep 28, 2014
40
36
Helsinki, FI
v1.2
- Added support for 10 flavourings
- Moved calculate & reset buttons above flavourings. With the flavourings-panel fully open the buttons became too hidden underneath.
- Added a cheeky "buy me a beer" donation button. :D So many beers have been consumed creating this, that it would be nice to someday be able to buy them back. :toast:

Next up is resetting individual flavouring fields.
 
Last edited:
Status
Not open for further replies.

Users who are viewing this thread