Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ValueAsDecimal()

decimal System.Xml.XmlSqlBinaryReader.ValueAsDecimal ( )
inlineprivate

Definition at line 3460 of file XmlSqlBinaryReader.cs.

3461 {
3463 switch (_token)
3464 {
3465 case BinXmlToken.SQL_SMALLINT:
3466 case BinXmlToken.SQL_INT:
3467 case BinXmlToken.SQL_BIT:
3468 case BinXmlToken.SQL_TINYINT:
3469 case BinXmlToken.SQL_BIGINT:
3470 case BinXmlToken.XSD_BYTE:
3471 case BinXmlToken.XSD_UNSIGNEDSHORT:
3472 case BinXmlToken.XSD_UNSIGNEDINT:
3473 return new decimal(ValueAsLong());
3474 case BinXmlToken.XSD_UNSIGNEDLONG:
3475 return new decimal(ValueAsULong());
3476 case BinXmlToken.SQL_REAL:
3477 return new decimal(GetSingle(_tokDataPos));
3478 case BinXmlToken.SQL_FLOAT:
3479 return new decimal(GetDouble(_tokDataPos));
3480 case BinXmlToken.SQL_SMALLMONEY:
3481 return new BinXmlSqlMoney(GetInt32(_tokDataPos)).ToDecimal();
3482 case BinXmlToken.SQL_MONEY:
3483 return new BinXmlSqlMoney(GetInt64(_tokDataPos)).ToDecimal();
3484 case BinXmlToken.SQL_DECIMAL:
3485 case BinXmlToken.SQL_NUMERIC:
3486 case BinXmlToken.XSD_DECIMAL:
3487 return new BinXmlSqlDecimal(_data, _tokDataPos, _token == BinXmlToken.XSD_DECIMAL).ToDecimal();
3488 default:
3490 }
3491 }
Exception ThrowUnexpectedToken(BinXmlToken token)

References System.Xml.XmlSqlBinaryReader._data, System.Xml.XmlSqlBinaryReader._tokDataPos, System.Xml.XmlSqlBinaryReader._token, System.Xml.XmlSqlBinaryReader.CheckValueTokenBounds(), System.Xml.XmlSqlBinaryReader.GetDouble(), System.Xml.XmlSqlBinaryReader.GetInt32(), System.Xml.XmlSqlBinaryReader.GetInt64(), System.Xml.XmlSqlBinaryReader.GetSingle(), System.Xml.XmlSqlBinaryReader.ThrowUnexpectedToken(), System.Xml.BinXmlSqlDecimal.ToDecimal(), System.Xml.BinXmlSqlMoney.ToDecimal(), System.Xml.XmlSqlBinaryReader.ValueAsLong(), and System.Xml.XmlSqlBinaryReader.ValueAsULong().

Referenced by System.Xml.XmlSqlBinaryReader.ReadContentAsDecimal(), System.Xml.XmlSqlBinaryReader.ValueAsDouble(), and System.Xml.XmlSqlBinaryReader.ValueAsLong().