Karin’s answer is right on point. Just keep in mind that carbs come from both simple sugars (glucose, fructose, maltose) and from complex carbs. The complex carbs take a bit longer to digest, so the impact on blood sugar will be a bit delayed. 4 calories/gram is an estimate, but it works well in calculations. Likewise with protein (4 cal/gr) and fat (9cal/gr). You can easily estimate the % of total calories from each of these nutrients with a little simple mathematics.