Silver dollars grow to 6" iirc but their minimum tank size is listed as 30 gallons so you might get away with it, however that is the minimum size so I dont know how happy the fish would be in there?
I really like Silver Dollar's but I only have a 27 gallon so chose to go with Black Skirt Tetra's instead as IMO they look quite similar to Silver Dollars, they are just smaller and have Black stripes + skirt, although ive heard they do turn silver as they get older.
Depending on the species of silver dollar, the smallest tank I'd recommend would have a foot print no smaller than 48"x12". Some of the larger species need tanks at least 10'x3'. There is a fish called the discus tetra that stays small and would be fine. Looks almost like a silver dollar, but tops out at two inches.