예제 #1
0
        private static void AssertAsciiToDecimal(string input, decimal expected)
        {
            var buf    = Encoding.ASCII.GetBytes(input);
            var actual = NumericBuffer.AsciiToDecimal(buf);

            Assert.AreEqual(expected, actual, $"Failed '{input}'");
        }
 public override long DecodeText(DataRow row, PostgresClientState state)
 {
     return(NumericBuffer.AsciiToLong(row.Data, 0, row.Length));
 }
 public override double DecodeText(DataRow row, PostgresClientState state)
 {
     return((double)NumericBuffer.AsciiToDecimal(row.Data, row.Length));
 }
 public override short DecodeText(DataRow row, PostgresClientState state)
 {
     return(NumericBuffer.AsciiToShort(row.Data, row.Length));
 }