Mega Code Archive

 
Categories / Ruby / Development
 

Printf prints its arguments under the control of a format string

printf("Number: %5.2f,\nString: %s\n", 1.23, "hello")  # produces:  # Number: 1.23,  # String: hello