Data type and format control characters

  • Fixed length decimal, float is 4 bytes, 8 bytes double
    % f decimal output type float
    % lf decimal output of the first two types of double default save six decimal places, insufficient bits 0s, over six truncated
    % e output exponentially decimal, the output e in lowercase
    % E output decimal exponentially, the output of E uppercase
    % le output decimal exponentially, the output e in lowercase
    % lE output decimal exponentially, the resulting output E capital
    % g is a more intelligent representation, using fewer characters

  • The default type numbers:
    integer default int, decimal default double.

Guess you like

Origin www.cnblogs.com/fennleo/p/12375560.html