"D" annoyances

Ty Tower tytower at hotmail.com.au
Sat Mar 15 14:32:49 PDT 2008


Ty Tower Wrote:

> Take them as things to be fixed or deny their existence 
> 
> Either way I will post here the stupid things I find as I go through bits and pieces .
> The best critic is the most schooled in the subject


Another
The output does not recognise "C" nor "alignment" ?
 Your lookers should not have to go delving to find out why, it needs to just work.
 
[tytower at linuxbox text]$ formatspec
I have {unknown format 'C'} in cash.
Avogadro's number is 6.02e+23.
Avogadro's number (with alignment) is 6.02e+23.


This is the example program which also appears in the tango book
/**

  Example showing how to use format specifier components in a format string's 
  argument.

  Put into public domain by Lars Ivar Igesund

*/

import tango.io.Stdout;

void main(){
    double avogadros = 6.0221415e23;
    Stdout.formatln("I have {0:C} in cash.", 100);
    Stdout.formatln("Avogadro's number is {0:E}.", avogadros);
    Stdout.formatln("Avogadro's number (with alignment) is {0,4:E}.", avogadros);
}




More information about the Digitalmars-d mailing list