• Daniel Kochmański's avatar
    format-f: Trailing digit is obligatory unless explicitly set d=0. · aa0a044c
    Daniel Kochmański authored and Daniel Kochmański's avatar Daniel Kochmański committed
    CLHS says that if field width is too small and no overflow character
    is specified then minimal number of characters necessary to print a
    number should be used.
    Printing float which characteristic is not zero should print also at
    least one digit of mantissa, because without trailing digit if put
    back to the reader it would be considered as integer. Exceptional
    situation is when mantissa length is explicitly set to zero.
        (format nil "~0f"   3.0)   ; correct result is 3.0
        (format nil "~0f"   3.123) ; correct result is 3.1
        (format nil "~0,0f" 3.123) ; correct result is 3.
    Signed-off-by: default avatarDaniel Kochmański <dkochmanski@turtle-solutions.eu>