Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: cbadab6bcf49a600deb058f05fc15247de21d015c62bfbab7d55a91d00ad2a17
Ticket: af4780b0b5245f035803b5fbeb1cfae62f40f821
Improve format #d documentation
User & Date: oehhar on 2025-09-03 11:38:54
Changes

  1. comment changed to:
    On clt, there was the following proposal by Marc Summerfield on the "#" specifier of the format command man page:
    
    <verbatim>
    I suggest replacing:
    
        For d conversions, 0d there is no effect unless the 0 specifier is used
        as well: In that case, 0d will be added to the beginning. 
    
    with:
    
        For d conversions, 0d has no effect; whereas both #d and #0d produce an
        0d prefix.
    
    Might also be worth adding:
    
        Note that width includes any prefix. For example "%06d" shows
        at least 6 digits, but "%#06d" shows at least 4 digits.
    
    Evidence:
    
    Main console display active (Tcl9.0.2 / Tk9.0.2)
    (mark) 61 % format "%d %0d %06d %#d %#0d %#06d" 12 13 14 15 16 17
    12 13 000014 0d15 0d16 0d0017
    </verbatim>
    
    Remark, that there is a change compared to Tcl 8.6.
    Tcl 8.6 returned:
    
    <verbatim>
    format "%d %0d %06d %#d %#0d %#06d" 12 13 14 15 16 17
    12 13 000014 15 16 000017
    </verbatim>
    
  2. login: "oehhar"
  3. mimetype: "text/plain"