Пример #1
0
        /// <summary>
        /// Answers a new instance of DecimalFormat with the same pattern and
        /// properties as this DecimalFormat.
        /// </summary>
        ///
        /// <returns>a shallow copy of this DecimalFormat</returns>
        /// <seealso cref="T:System.ICloneable"/>
        public Object Clone()
        {
            DecimalFormat clone = (DecimalFormat)base.Clone();

            clone.dform   = (IBM.ICU.Text.DecimalFormat)dform.Clone();
            clone.symbols = (DecimalFormatSymbols)symbols.Clone();
            return(clone);
        }
Пример #2
0
 /// <summary>
 /// Sets the DecimalFormatSymbols used by this DecimalFormat.
 /// </summary>
 ///
 /// <param name="value">the DecimalFormatSymbols</param>
 public void SetDecimalFormatSymbols(DecimalFormatSymbols value_ren)
 {
     if (value_ren != null)
     {
         symbols    = (DecimalFormatSymbols)value_ren.Clone();
         icuSymbols = dform.GetDecimalFormatSymbols();
         CopySymbols(icuSymbols, symbols);
         dform.SetDecimalFormatSymbols(icuSymbols);
     }
 }
Пример #3
0
        /// <summary>
        /// Constructs a new DecimalFormat using the specified non-localized pattern
        /// and DecimalFormatSymbols.
        /// </summary>
        ///
        /// <param name="pattern">the non-localized pattern</param>
        /// <param name="value">the DecimalFormatSymbols</param>
        /// <exception cref="IllegalArgumentException">when the pattern cannot be parsed</exception>
        public DecimalFormat(String pattern, DecimalFormatSymbols value_ren)
        {
            this.parseBigDecimal       = false;
            this.serialVersionOnStream = 3;
            symbols = (DecimalFormatSymbols)value_ren.Clone();
            ILOG.J2CsMapping.Util.Locale locale = symbols.GetLocale(); //$NON-NLS-1$
            icuSymbols = new IBM.ICU.Text.DecimalFormatSymbols(locale);
            CopySymbols(icuSymbols, symbols);

            dform = new IBM.ICU.Text.DecimalFormat(pattern, icuSymbols);

            base.SetMaximumFractionDigits(dform.GetMaximumFractionDigits());
            base.SetMaximumIntegerDigits(dform.GetMaximumIntegerDigits());
            base.SetMinimumFractionDigits(dform.GetMinimumFractionDigits());
            base.SetMinimumIntegerDigits(dform.GetMinimumIntegerDigits());
        }