Just from a code cleanliness standpoint, you might want to use a StringBuffer or something here. Modifying long String.format()s can get hairy.