Perl Formatted Ref

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 1

Table 4.4.

Format Specifiers Conversion Definition %b %c %d, i %e %E %f, %F %g %G %ld, %D %lu, %U %lo, %O %p %s %u %x %X %lx %% Unsigned binary integer Character Decimal number Floating point number in scientific notation Floating point number in scientific notation using capital E Floating point number Floating point number using either e or f conversion, whichever takes the least space Floating point number using either e or f conversion, whichever takes the least space Long decimal number Long unsigned decimal number Long octal number Pointer (hexadecimal) String Unsigned decimal number Hexadecimal number Hexadecimal number using capital X Long hexidecimal number Print a literal percent sign Table 4.5. Flag Modifiers Conversion Definition %%# %+ %0 %number %.number Left-justification modifier Integers in octal format are displayed with a leading 0; integers in hexadecimal form are displayed with a leading 0x For conversions using d, e, f, and g, integers are displayed with a numeric sign, + or The displayed value is padded with zeros instead of whitespace Maximum field width; for example, if number is 6, as in %6d, maximum field width is six digits Precision of a floating point number; for example, %.2f specifies a precision of two digits to the right of the decimal point, and %8.2 represents a maximum field width of eight, where one of the characters is a decimal point followed by two digits after the decimal point

You might also like