Exemplo n.º 1
0
        internal unsafe void GetNFIValues(NumberFormatInfo nfi)
        {
            if (this.IsInvariantCulture)
            {
                // Same as default values
            }
            else
            {
                //
                // We don't have information for the following four.  All cultures use
                // the same value of the number formatting values.
                //
                // PercentDecimalDigits
                // PercentDecimalSeparator
                // PercentGroupSize
                // PercentGroupSeparator
                //
                var   nfe  = new NumberFormatEntryManaged();
                byte *data = fill_number_data(numberIndex, ref nfe);
                nfi.currencyGroupSizes       = create_group_sizes_array(nfe.currency_group_sizes0, nfe.currency_group_sizes1);
                nfi.numberGroupSizes         = create_group_sizes_array(nfe.number_group_sizes0, nfe.number_group_sizes1);
                nfi.NaNSymbol                = idx2string(data, nfe.nan_symbol);
                nfi.currencyDecimalDigits    = nfe.currency_decimal_digits;
                nfi.currencyDecimalSeparator = idx2string(data, nfe.currency_decimal_separator);
                nfi.currencyGroupSeparator   = idx2string(data, nfe.currency_group_separator);
                nfi.currencyNegativePattern  = nfe.currency_negative_pattern;
                nfi.currencyPositivePattern  = nfe.currency_positive_pattern;
                nfi.currencySymbol           = idx2string(data, nfe.currency_symbol);
                nfi.negativeInfinitySymbol   = idx2string(data, nfe.negative_infinity_symbol);
                nfi.negativeSign             = idx2string(data, nfe.negative_sign);
                nfi.numberDecimalDigits      = nfe.number_decimal_digits;
                nfi.numberDecimalSeparator   = idx2string(data, nfe.number_decimal_separator);
                nfi.numberGroupSeparator     = idx2string(data, nfe.number_group_separator);
                nfi.numberNegativePattern    = nfe.number_negative_pattern;
                nfi.perMilleSymbol           = idx2string(data, nfe.per_mille_symbol);
                nfi.percentNegativePattern   = nfe.percent_negative_pattern;
                nfi.percentPositivePattern   = nfe.percent_positive_pattern;
                nfi.percentSymbol            = idx2string(data, nfe.percent_symbol);
                nfi.positiveInfinitySymbol   = idx2string(data, nfe.positive_infinity_symbol);
                nfi.positiveSign             = idx2string(data, nfe.positive_sign);
            }

            //
            // We don't have percent values, so use the number values
            //
            nfi.percentDecimalDigits    = nfi.numberDecimalDigits;
            nfi.percentDecimalSeparator = nfi.numberDecimalSeparator;
            nfi.percentGroupSizes       = nfi.numberGroupSizes;
            nfi.percentGroupSeparator   = nfi.numberGroupSeparator;
        }
Exemplo n.º 2
0
 extern unsafe static byte *fill_number_data(int index, ref NumberFormatEntryManaged nfe);