コード例 #1
0
 public virtual void print(SupportClass.TextNumberFormat format, int width)
 {
     this.print(new StreamWriter(Console.OpenStandardOutput(), Encoding.Default)
     {
         AutoFlush = true
     }, format, width);
 }
コード例 #2
0
        private static String uft()
        {
            System.Diagnostics.Process rt = System.Diagnostics.Process.GetCurrentProcess();
            long free = rt.freeMemory(), total = rt.totalMemory(), used = total - free;

            //		long max = rt.maxMemory();
            SupportClass.TextNumberFormat nf = SupportClass.TextNumberFormat.getTextNumberInstance();
            //        System.out.println("used: "+nf.format(used)+" free: "+nf.format(free)+" total: "+nf.format(total)+" max: "+nf.format(max));
            return(", used " + nf.FormatLong(used) + ", free " + nf.FormatLong(free) + ", total " + nf.FormatLong(total));            //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
        }
コード例 #3
0
ファイル: MDLWriter.cs プロジェクト: carlhuth/GenXSource
 /// <summary> Formats an int to fit into the connectiontable and changes it
 /// to a String.
 ///
 /// </summary>
 /// <param name="i"> The int to be formated
 /// </param>
 /// <param name="l"> Length of the String
 /// </param>
 /// <returns>     The String to be written into the connectiontable
 /// </returns>
 private System.String formatMDLInt(int i, int l)
 {
     System.String s = "", fs = "";
     SupportClass.TextNumberFormat nf = SupportClass.TextNumberFormat.getTextNumberInstance(new System.Globalization.CultureInfo("en"));
     //UPGRADE_ISSUE: Method 'java.text.NumberFormat.setParseIntegerOnly' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javatextNumberFormatsetParseIntegerOnly_boolean'"
     //nf.setParseIntegerOnly(true);
     nf.setMinimumIntegerDigits(1);
     nf.setMaximumIntegerDigits(l);
     nf.GroupingUsed = false;
     s = nf.FormatLong(i);
     l = l - s.Length;
     for (int f = 0; f < l; f++)
     {
         fs += " ";
     }
     fs += s;
     return(fs);
 }
コード例 #4
0
 public virtual void print(StreamWriter output, SupportClass.TextNumberFormat format, int width)
 {
     output.WriteLine();
     for (int i = 0; i < this.m; i++)
     {
         for (int j = 0; j < this.n; j++)
         {
             string text = format.FormatDouble(this.A[i][j]);
             int    num  = Math.Max(1, width - text.Length);
             for (int k = 0; k < num; k++)
             {
                 output.Write(' ');
             }
             output.Write(text);
         }
         output.WriteLine();
     }
     output.WriteLine();
 }
コード例 #5
0
ファイル: MDLWriter.cs プロジェクト: carlhuth/GenXSource
        /// <summary> Formats a float to fit into the connectiontable and changes it
        /// to a String.
        ///
        /// </summary>
        /// <param name="fl"> The float to be formated
        /// </param>
        /// <returns>      The String to be written into the connectiontable
        /// </returns>
        private System.String formatMDLFloat(float fl)
        {
            System.String s = "", fs = "";
            int           l;

            SupportClass.TextNumberFormat nf = SupportClass.TextNumberFormat.getTextNumberInstance(new System.Globalization.CultureInfo("en"));
            nf.setMinimumIntegerDigits(1);
            nf.setMaximumIntegerDigits(4);
            nf.setMinimumFractionDigits(4);
            nf.setMaximumFractionDigits(4);
            nf.GroupingUsed = false;
            s = nf.FormatDouble(fl);
            l = 10 - s.Length;
            for (int f = 0; f < l; f++)
            {
                fs += " ";
            }
            fs += s;
            return(fs);
        }
コード例 #6
0
		public static SupportClass.TextNumberFormat getTextNumberPercentInstance(CultureInfo culture)
		{
			SupportClass.TextNumberFormat textNumberFormat = new SupportClass.TextNumberFormat(SupportClass.TextNumberFormat.formatTypes.Percent, culture, 3);
			return textNumberFormat.setToPercentNumberFormatDefaults(textNumberFormat);
		}
コード例 #7
0
		public static SupportClass.TextNumberFormat getTextNumberCurrencyInstance(CultureInfo culture)
		{
			SupportClass.TextNumberFormat textNumberFormat = new SupportClass.TextNumberFormat(SupportClass.TextNumberFormat.formatTypes.Currency, culture, 3);
			return textNumberFormat.setToCurrencyNumberFormatDefaults(textNumberFormat);
		}