The formula of the compound is
.
The formula of an ionic compound is determined by the balance of positive and negative charges in the compound. Ionic compounds are formed by the combination of positively charged ions (cations) and negatively charged ions (anions).
There would be an exchange of valance between the ions and then potassium would have a subscript of two and sulfur will have a subscript of one in the formula. The formula of the compound can be given as
by the exchange of the valences available.