switch for string format syntax and catch ToDouble exceptions