Ruby/Development/printf
Материал из Wiki.crossplatform.ru
Содержание |
printf("%.55f",1)
printf("%.55f", 1.8 + 0.1)
printf("%.55f", 1.9)
printf("%.55f", 1.9)
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
printf with format
printf("Number: %5.2f,\nString: %s\n", 1.23, "hello")
Use printf to print the output to your display (the default standard output device).
printf( "Hello, %s", "Matz!" ) # => Hello, Matz!