Spaces:
Sleeping
Sleeping
Upload main.py
Browse files182 unmodified lines183184185186187188189182 unmodified linesnum_str = str(value).replace('$', '').replace(',', '').strip()if not num_str or num_str.lower() == 'n/a': return 'N/A'num = float(num_str)return f"${num:,.0f}"except (ValueError, TypeError):# Allow text like "Event", "Unobtainable" etc. to pass throughif isinstance(value, str) and value.strip() and not re.match(r'^-?[\d,.$]+\$?$', value.strip()):182 unmodified lines183184185186187188189190191192193194195182 unmodified linesnum_str = str(value).replace('$', '').replace(',', '').strip()if not num_str or num_str.lower() == 'n/a': return 'N/A'num = float(num_str)# Check if the number has decimal placesif num == int(num):# For whole numbers, display without decimal placesreturn f"${num:,.0f}"else:# For numbers with decimal places, preserve themreturn f"${num:,}"except (ValueError, TypeError):# Allow text like "Event", "Unobtainable" etc. to pass throughif isinstance(value, str) and value.strip() and not re.match(r'^-?[\d,.$]+\$?$', value.strip()):
main.py+7-1