FileDocCategorySizeDatePackage
PercentPatternList.javaAPI DocExample1000Sun Mar 28 19:09:24 BST 1999None

PercentPatternList

public class PercentPatternList extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

  
    FileOutputStream fout = new FileOutputStream(args[0]);
    OutputStreamWriter osw = new OutputStreamWriter(fout, "UnicodeLittle");
    osw.write(0xFE);
    osw.write(0xFF);
    PrintWriter pw = new PrintWriter(osw);
    Locale list[] = NumberFormat.getAvailableLocales();

    pw.println("Language (Country)\tPattern\tExample 0.7432");
    for (int i = 0; i < list.length; i++) {
      NumberFormat nsample = NumberFormat.getPercentInstance(list[i]);
      if (nsample instanceof DecimalFormat) {
//        pw.print(list[i].getDisplayLanguage());
        pw.print(list[i].getDisplayName() + "\t");
        DecimalFormat sample = (DecimalFormat) nsample;
        pw.print(sample.toPattern() + "\t"); 
        pw.print(sample.format(0.7423));
        pw.println();
      }

    }  
    pw.close();