formats stored data into string