Fix undefined variable error if format is not set
Merge pull request #757 from Sophist-UK/sophist_fix_calc_undefined_variable

Fix undefined variable error if format is not set