$subformat was being set rather than checked in if statement

Line 266, changed = to == so the if statement works.