There is no universal definition of how this is done. This therefore typically winds up being up to the law enforcement representative at the time. For example, many LEOs will specifically look only at the actual edge length; others measure from tip to tang. Quite an unfortunate few will consider the entire weapon, butt to tip.
Remember that vague interpretations are intentional...not to make lawyers rich...but to help get obviously guilty but borderline evidentiary fools off the street, and allow clearly responsible knife owners leeway to keep knives in their hands.
You can argue, but that loophole works both ways.