I jacked up the format_cap function with negative numbers by doing replace wrong. Fixed.