CalMag is one of two blends, usually.
Either
A. Calcium Nitrate and Magnesium Nitrate.
or
B. Calcium Nitrate and Magnesium Sulfate Heptahydrate
Often times some chelated(pronounced key-lated) micronutrients are added, most commonly Iron-EDTA.
To most common form of Calcium Nitrate is actually a specific calcium ammonium nitrate double salt that is 14.4% Nitrogen as N-NO3, 1.1% Nitrogen as NH4, and 19% Ca, by weight. No Oxygen or Hydrogen is counted when measuring nutrient percentages in fertilizer. It's chemical formula is 5Ca(NO3)2·NH4NO3·10H2O
Magnesium Nitrate is hygroscopic salt with the formula Mg(NO3)2. It is 11% Nitrogen as N-NO3 and 9.6% Mg by weight. Again, no oxygen is counted.
Magnesium Sulfate Heptahydrate, or Epsom Salt, encountered as the heptahydrate
sulfate mineral epsomite, MgSO4·7H2O. 9.1% Mg, 14% S (42% SO4) by weight.
Calcium Nitrate can be found for $6-9 for 2.5kg(~5lbs).
Magnesium Nitrate can be found for $$6-9 for 2.5kg(~5lbs).
Magnesium Sulfate Heptahydrate, or Epson Salt, can be found for $5-7 for 2.5kg(5lb)
Now, lets assume you buy 2.5kg of two different fertilizers and pay for shipping, assume shipping costs you $18, which is about what it might cost for FedEx to send 5kg half way across the US. Total cost will be ~$34 for any two of those. $17 for 2.5kg is the extended cost. $0.0068/g.
For Blend A, using Calcium Nitrate and Magnesium Nitrate, consider this blend:
170g/L of Calcium Nitrate ($1.16/L)
125g/L of Magnesium Nitrate ($0.85/L)
This creates a fertilizer blend that is is 4% Nitrogen, 3.2% Calcium, and 1.2% Magnesium, weight/volume%.
For Blend B, using Calcium Nitrate and Magnesium Sulfate Heptahydrate, consider this blend:
170g/L of Calcium Nitrate ($1.16/L)
130g/L of Magnesium Sulfate ($0.88/L)
This creates a fertilizer blend of 2.6% Nitrogen, 3.2% Calcium, 1.2% Magnesium, and 1.8% Sulfur, weight/volume%.
Extend all those out to 1 gallon. Including the cost of 1 gallon of distilled water, for $1 at your grocery store.
Blend A = $8.60
Blend B = $8.72
Although you just spent $34, the same cost for a gallon, you now have enough for about 4 gallons.