It's often seen in shops: for example, if they sell a box containing 3 pens, they call it 'pen, 3-pack'. I'm wondering what's the relevant grammar rule is used in this phrase (number-hyphen-pack)?
From a native speaker:
The relevant grammar rule is that in marketing, as in road signs and billboards, formal rules are suspended for space or urgency.
The road sign "Slow children" does not mean that children in the area are slow of mind, as every driver knows. The proper words for the sign would be "Slow down and watch children" or "Drive slowly, as children are at play," but by the time you read that entire sign, you might have run into a few of those children.
Thus, the language on merchandise cards is abbreviated. If the shopper understands, the mission is accomplished. Today the sign may say 'pen, 3-pack.' Tomorrow it can say 'All New! Triple Package' or '3-pen set.' One look will tell you that three pens are sold together, with a volume discount built into the price.