Added functions setFormatAndGstring and setFormatString