I cant really verify that this works since i dont have "altova"
def printFacts( facts, indent=1, targetDate=None ): my_list = [] for fact in facts: if targetDate==None or fact.context.period.instant == targetDate: if fact.concept.item_type==fact.concept.MONETARY_ITEM_TYPE: my_list.append(fact.effective_numeric_value) #print( indent * "\t", camelToSpaces( fact.qname.local_name ).ljust(100-indent*8), "$", '{0:>16,}'.format( factValue ) ) else: my_list.append(fact.normalized_value) #print( indent * "\t", camelToSpaces( fact.qname.local_name ).ljust(100-indent*8), factValue ) return my_listIf you want the prints uncommented you would have to remove this
{0:>16,}
to just {} as thats not going to work on a list like it did a single string value
Recommended Tutorials: