Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Changeset 3034

Show
Ignore:
Timestamp:
12/17/07 14:21:16 (1 year ago)
Author:
larsivi
Message:

Prepending a single custom format specifier with % makes it possible for the underlying value to be printed in a non-padded fashion. Follows the .net spec in this regard. Thx darrylb. closes #816

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/tango/text/locale/Convert.d

    r3025 r3034  
    322322                char[10] tmp; 
    323323 
     324                if (format[0] is '%') 
     325                    { 
     326                    // specifiers for both standard format strings and custom ones 
     327                    const char[] commonSpecs = "dmMsty"; 
     328                    foreach (c; commonSpecs) 
     329                        if (format[1] is c) 
     330                            { 
     331                            index += 1; 
     332                            break; 
     333                            } 
     334                    } 
     335 
    324336                while (index < format.length) 
    325337                      {