Exemplo n.º 1
0
        /// <summary>
        ///   Initializes a new instance of the <see cref="Money" /> struct equal to <paramref name="value" />.
        /// </summary>
        /// <param name="value">
        ///   The value.
        /// </param>
        public Money(Decimal value)
        {
            checkValue(value);

            _units           = (Int64)value;
            _decimalFraction = (Int32)Math.Round((value - _units) * FractionScale);

            if (_decimalFraction >= FractionScale)
            {
                _units          += 1;
                _decimalFraction = _decimalFraction - (Int32)FractionScale;
            }

            _currency = Currency.FromCurrentCulture();
        }