Ejemplo n.º 1
0
        public CommonWorkbook()
        {
            const int maxBuiltInFormats = 163;

            for (var i = 0; i < maxBuiltInFormats; i++)
            {
                var numFmt = BuiltinNumberFormat.GetBuiltinNumberFormat(i);
                if (numFmt != null)
                {
                    Formats.Add(i, numFmt);
                }
            }
        }
Ejemplo n.º 2
0
        public NumberFormatString GetNumberFormatString(int numberFormatIndex)
        {
            if (Formats.TryGetValue(numberFormatIndex, out var numberFormat))
            {
                return(numberFormat);
            }

            numberFormat = BuiltinNumberFormat.GetBuiltinNumberFormat(numberFormatIndex);
            if (numberFormat != null)
            {
                return(numberFormat);
            }

            // Fall back to "General" if the number format index is invalid
            return(GeneralNumberFormat);
        }