fix missing type length calculation in formatting function types