コード例 #1
0
ファイル: Field129.cs プロジェクト: arielhernannapoli/ProWide
 /// <summary>
 /// Returns a localized suitable for showing to humans string of a field component.<br>
 /// </summary>
 /// <param name="component"> number of the component to display </param>
 /// <param name="locale"> optional locale to format date and amounts, if null, the default locale is used </param>
 /// <returns> formatted component value or null if component number is invalid or not present </returns>
 /// <exception cref="IllegalArgumentException"> if component number is invalid for the field
 /// @since 7.8 </exception>
 public override string getValueDisplay(int component, Locale locale)
 {
     if (component < 1 || component > 2)
     {
         throw new System.ArgumentException("invalid component number " + component + " for field 129");
     }
     if (component == 1)
     {
         //number, amount, rate
         java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale));
         f.MaximumFractionDigits = 13;
         Number n = Component1AsNumber;
         if (n != null)
         {
             return(f.format(n));
         }
     }
     if (component == 2)
     {
         //number, amount, rate
         java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale));
         f.MaximumFractionDigits = 13;
         Number n = Component2AsNumber;
         if (n != null)
         {
             return(f.format(n));
         }
     }
     return(null);
 }
コード例 #2
0
 /// <summary>
 /// Returns a localized suitable for showing to humans string of a field component.<br>
 /// </summary>
 /// <param name="component"> number of the component to display </param>
 /// <param name="locale"> optional locale to format date and amounts, if null, the default locale is used </param>
 /// <returns> formatted component value or null if component number is invalid or not present </returns>
 /// <exception cref="IllegalArgumentException"> if component number is invalid for the field
 /// @since 7.8 </exception>
 public override string getValueDisplay(int component, Locale locale)
 {
     if (component < 1 || component > 6)
     {
         throw new System.ArgumentException("invalid component number " + component + " for field 258");
     }
     if (component == 1)
     {
         //default format (as is)
         return(getComponent(1));
     }
     if (component == 2)
     {
         //number, amount, rate
         java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale));
         f.MaximumFractionDigits = 13;
         Number n = Component2AsNumber;
         if (n != null)
         {
             return(f.format(n));
         }
     }
     if (component == 3)
     {
         //default format (as is)
         return(getComponent(3));
     }
     if (component == 4)
     {
         //date
         java.text.DateFormat f   = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale));
         DateTime             cal = Component4AsCalendar;
         if (cal != null)
         {
             return(f.format(cal.Ticks));
         }
     }
     if (component == 5)
     {
         //time
         java.text.DateFormat f   = new java.text.SimpleDateFormat("HH:mm", notNull(locale));
         DateTime             cal = Component5AsCalendar;
         if (cal != null)
         {
             return(f.format(cal.Ticks));
         }
     }
     if (component == 6)
     {
         //time
         java.text.DateFormat f   = new java.text.SimpleDateFormat("HH:mm", notNull(locale));
         DateTime             cal = Component6AsCalendar;
         if (cal != null)
         {
             return(f.format(cal.Ticks));
         }
     }
     return(null);
 }
コード例 #3
0
ファイル: Calendar.cs プロジェクト: wangchengqun/janett
        public override void run()
        {
            NumberFormat nf  = NumberFormat.getNumberInstance();
            string       str = nf.format(10);

            HolyDay_Property = 5;
            Process proc = new Process();

            run_Field = proc.waitFor();
        }