From printf to sprintf