System.NumberFormatter.Init C# (CSharp) Méthode

Init() private méthode

private Init ( string format ) : void
format string
Résultat void
		private void Init (string format)
		{
			_val1 = _val2 = _val3 = _val4 = 0;
			_offset = 0;
			_NaN = _infinity = false;
			_isCustomFormat = false;
			_specifierIsUpper = true;
			_precision = -1;

			if (format == null || format.Length == 0) {
				_specifier = 'G';
				return;
			}

			char specifier = format [0];
			if (specifier >= 'a' && specifier <= 'z') {
				specifier = (char)(specifier - 'a' + 'A');
				_specifierIsUpper = false;
			}
			else if (specifier < 'A' || specifier > 'Z') {
				_isCustomFormat = true;
				_specifier = '0';
				return;
			}
			_specifier = specifier;
			if (format.Length > 1) {
				_precision = ParsePrecision (format);
				if (_precision == -2) { // Is it a custom format?
					_isCustomFormat = true;
					_specifier = '0';
					_precision = -1;
				}
			}
		}

Same methods

NumberFormatter::Init ( string format, decimal value ) : void
NumberFormatter::Init ( string format, double value, int defPrecision ) : void
NumberFormatter::Init ( string format, int value, int defPrecision ) : void
NumberFormatter::Init ( string format, long value ) : void
NumberFormatter::Init ( string format, uint value, int defPrecision ) : void
NumberFormatter::Init ( string format, ulong value ) : void