Fix formatting for non-string values in arrays

fixes #7388