AT.MIN.Tools.FormatOct C# (CSharp) 메소드

FormatOct() 개인적인 정적인 메소드

private static FormatOct ( string NativeFormat, bool Alternate, int FieldLength, int FieldPrecision, bool Left2Right, char Padding, object Value ) : string
NativeFormat string
Alternate bool
FieldLength int
FieldPrecision int
Left2Right bool
Padding char
Value object
리턴 string
		private static string FormatOct( string NativeFormat, bool Alternate,
											int FieldLength, int FieldPrecision,
											bool Left2Right,
											char Padding, object Value )
		{
			string w = String.Empty;
			string lengthFormat = "{0" + ( FieldLength != int.MinValue ?
											"," + ( Left2Right ?
													"-" :
													String.Empty ) + FieldLength.ToString() :
											String.Empty ) + "}";

			if ( IsNumericType( Value ) )
			{
				w = Convert.ToString( UnboxToLong( Value, true ), 8 );

				if ( Left2Right || Padding == ' ' )
				{
					if ( Alternate && w != "0" )
						w = "0" + w;
					w = String.Format( lengthFormat, w );
				}
				else
				{
					if ( FieldLength != int.MinValue )
						w = w.PadLeft( FieldLength - ( Alternate && w != "0" ? 1 : 0 ), Padding );
					if ( Alternate && w != "0" )
						w = "0" + w;
				}
			}

			return w;
		}
		#endregion