public void TestMantissaAndExponent()
        {
            var value = new DecimalValue(9427.55);
            AssertEquals(942755, value.mantissa);
            AssertEquals(-2, value.exponent);

            value = new DecimalValue(942755, -2);
            AssertEquals(((decimal)9427.55), value.ToBigDecimal());
        }
        public void TestLookupMultipleValuesForTemplate()
        {
            Dictionary dictionary = new TemplateDictionary();
            Group template = new MessageTemplate("Position",
                    new Field[] {
                    new Scalar("exchange", FASTType.STRING, Operator.COPY, ScalarValue.UNDEFINED, false)
                });
            ScalarValue value = new StringValue("NYSE");
            ScalarValue marketValue = new DecimalValue(100000.00);
            dictionary.Store(template, FastConstants.ANY_TYPE, new QName("exchange"), value);
            dictionary.Store(template, FastConstants.ANY_TYPE, new QName("marketValue"), marketValue);

            Assert.IsFalse(value.Equals(ScalarValue.UNDEFINED));
            Assert.AreEqual(value, dictionary.Lookup(template, new QName("exchange"), FastConstants.ANY_TYPE));
            Assert.AreEqual(marketValue, dictionary.Lookup(template, new QName("marketValue"), FastConstants.ANY_TYPE));
        }
示例#3
0
 public void SetDecimal(int fieldIndex, Decimal value)
 {
     _values[fieldIndex] = new DecimalValue(value);
 }
 public void TestMaxValue()
 {
     var max = new DecimalValue(int.MaxValue, 10);
     AssertEquals(new Decimal(2147483647e10), max.ToBigDecimal());
 }
示例#5
0
 public virtual void  SetDecimal(int fieldIndex, Decimal value_Renamed)
 {
     values[fieldIndex] = new DecimalValue(value_Renamed);
 }
示例#6
0
 public void SetDecimal(int fieldIndex, Decimal value)
 {
     _values[fieldIndex] = new DecimalValue(value);
 }
示例#7
0
 public bool equals(DecimalValue other)
 {
     return(other.mantissa == mantissa && other.exponent == exponent);
 }
示例#8
0
 public virtual void SetDecimal(int fieldIndex, Decimal value_Renamed)
 {
     values[fieldIndex] = new DecimalValue(value_Renamed);
 }
 public bool equals(DecimalValue other)
 {
     return other.mantissa == mantissa && other.exponent == exponent;
 }