Here is the "formula"
When we talk about "less than 10% carbs" we are reffering to the fact that the food has say 8% of it's calories from carbohydrates. The actual carbohydrate amount (scientifically Nitrogen free extract=NfE) in the orginal or dry substance is calculated as follows using as fed values (not the Minimum and maximim given on most labels)
Subtract the as fed values of protien, fat, ash, fiber, and moisure from 100%
100% - crude protien% - crude fat% - ash% - crude fiber% - moisture% = NfE (carbohydrate)%
example canned food: 100% - 10% - 5,5% - 2,5% - 1,0% - 79% = 2% NfE
example dry food: 100% - 30% - 10% - 6,5% - 2,5% - 9% = 42% NfE
To calculate the carbohydrate content in the dry substance
canned food: 100% - 79% moisture = 21% dry matter (DM) = 0,21
dry food: 100% - 9% moisture = 91% dry matter (DM) = 0,91
Then divide the carbohydrate procent by the DM
canned food: 2% NfE / 0,21 = 9,52% carbs in the dry substance
dry food: 42% NfE / 0,91 = 46,15% carbs in the dry substance
To calculate calories each component has a differnt calorie value (depending on digestability typically the modified Atwater-Factor is used:
Protein: 3,5 kcal/g, Fat: 8,5 kcal/g, NfE (carbohydrates): 3,5 kcal/g
The Energy in kcal / 100 g Food is calculated as follows:
(%Protein * 3,5 kcal/g) + (%Fat * 8,5 kcal/g) + (%NfE * 3,5 kcal/g)