taos> select TRUNCATE(10.55, 3) truncate(10.55, 3) | ============================ 10.55 | taos> select TRUNCATE(10.55, 2) truncate(10.55, 2) | ============================ 10.55 | taos> select TRUNCATE(10.55, 1) truncate(10.55, 1) | ============================ 10.5 | taos> select TRUNCATE(10.55, 0) truncate(10.55, 0) | ============================ 10 | taos> select TRUNCATE(10.55, -1) truncate(10.55, -1) | ============================ 10 | taos> select TRUNCATE(10.55, -10) truncate(10.55, -10) | ============================ 0 | taos> select TRUNCATE(-10.55, 1) truncate(-10.55, 1) | ============================ -10.5 | taos> select TRUNCATE(99, 1) truncate(99, 1) | ======================== 99 | taos> select TRUNCATE(10.55, 1) + 1 truncate(10.55, 1) + 1 | ============================ 11.5 | taos> select TRUNCATE(TRUNCATE(TRUNCATE(TRUNCATE(TRUNCATE(TRUNCATE(TRUNCATE(123.123456789, 9), 8), 7), 6), 5), 4), 3) truncate(truncate(truncate(truncate(truncate(truncate(truncate(1 | =================================================================== 123.123 | taos> select TRUNCATE(TRUNCATE(TRUNCATE(TRUNCATE(TRUNCATE(TRUNCATE(TRUNCATE(123456789.123456789, -1), -2), -3), -4), -5), -6), -7) truncate(truncate(truncate(truncate(truncate(truncate(truncate(1 | =================================================================== 120000000 | taos> select TRUNCATE(87654321.123456789, id) from ts_4893.meters order by ts limit 10 truncate(87654321.123456789, id) | =================================== 87654321 | 87654321.1 | 87654321.12 | 87654321.123 | 87654321.1234 | 87654321.12345 | 87654321.123456 | 87654321.1234567 | 87654321.1234568 | 87654321.1234568 | taos> select TRUNCATE(current, id) from ts_4893.meters order by ts limit 10 truncate(current, id) | ======================== 10 | 8.5 | 9.79 | 11.233 | 10.706 | 8.508 | 9.596 | 10.962 | 11.226 | 10.337 | taos> select TRUNCATE(current, 1) from ts_4893.meters order by ts limit 10 truncate(current, 1) | ======================= 10.6 | 8.5 | 9.7 | 11.2 | 10.7 | 8.5 | 9.5 | 10.9 | 11.2 | 10.3 | taos> select TRUNC(10.55, 3) trunc(10.55, 3) | ============================ 10.55 | taos> select TRUNC(10.55, 2) trunc(10.55, 2) | ============================ 10.55 | taos> select TRUNC(10.55, 1) trunc(10.55, 1) | ============================ 10.5 | taos> select TRUNC(10.55, 0) trunc(10.55, 0) | ============================ 10 | taos> select TRUNC(10.55, -1) trunc(10.55, -1) | ============================ 10 | taos> select TRUNC(10.55, -10) trunc(10.55, -10) | ============================ 0 | taos> select TRUNC(-10.55, 1) trunc(-10.55, 1) | ============================ -10.5 | taos> select TRUNC(99, 1) trunc(99, 1) | ======================== 99 | taos> select TRUNC(10.55, 1) + 1 trunc(10.55, 1) + 1 | ============================ 11.5 | taos> select TRUNC(TRUNC(TRUNC(TRUNC(TRUNC(TRUNC(TRUNC(123.123456789, 9), 8), 7), 6), 5), 4), 3) trunc(trunc(trunc(trunc(trunc(trunc(trunc(123.123456789, 9), 8), | =================================================================== 123.123 | taos> select TRUNC(TRUNC(TRUNC(TRUNC(TRUNC(TRUNC(TRUNC(123456789.123456789, -1), -2), -3), -4), -5), -6), -7) trunc(trunc(trunc(trunc(trunc(trunc(trunc(123456789.123456789, - | =================================================================== 120000000 | taos> select TRUNC(87654321.123456789, id) from ts_4893.meters order by ts limit 10 trunc(87654321.123456789, id) | ================================ 87654321 | 87654321.1 | 87654321.12 | 87654321.123 | 87654321.1234 | 87654321.12345 | 87654321.123456 | 87654321.1234567 | 87654321.1234568 | 87654321.1234568 | taos> select TRUNC(current, id) from ts_4893.meters order by ts limit 10 trunc(current, id) | ======================= 10 | 8.5 | 9.79 | 11.233 | 10.706 | 8.508 | 9.596 | 10.962 | 11.226 | 10.337 | taos> select TRUNC(current, 1) from ts_4893.meters order by ts limit 10 trunc(current, 1) | ======================= 10.6 | 8.5 | 9.7 | 11.2 | 10.7 | 8.5 | 9.5 | 10.9 | 11.2 | 10.3 | taos> select truncate(99.99, 3) truncate(99.99, 3) | ============================ 99.99 | taos> select truncate(99.99, 2) truncate(99.99, 2) | ============================ 99.99 | taos> select truncate(99.99, 1) truncate(99.99, 1) | ============================ 99.9 | taos> select truncate(99.99, 0) truncate(99.99, 0) | ============================ 99 | taos> select truncate(99.99, -1) truncate(99.99, -1) | ============================ 90 | taos> select truncate(99.99, -10) truncate(99.99, -10) | ============================ 0 | taos> select truncate(99, 1) truncate(99, 1) | ======================== 99 | taos> select truncate(current, 1) from ts_4893.d0 order by ts limit 10 truncate(current, 1) | ======================= 10.6 | 8.5 | 9.7 | 11.2 | 10.7 | 8.5 | 9.5 | 10.9 | 11.2 | 10.3 | taos> select truncate(current, 1) from ts_4893.meters order by ts limit 10 truncate(current, 1) | ======================= 10.6 | 8.5 | 9.7 | 11.2 | 10.7 | 8.5 | 9.5 | 10.9 | 11.2 | 10.3 | taos> select truncate(99.99, null) truncate(99.99, null) | ============================ NULL | taos> select truncate(null, 3) truncate(null, 3) | ==================== NULL | taos> select truncate(1.0001, 3) truncate(1.0001, 3) | ============================ 1 | taos> select truncate(2.71828, 4) truncate(2.71828, 4) | ============================ 2.7182 | taos> select truncate(3.14159, 2) truncate(3.14159, 2) | ============================ 3.14 | taos> select truncate(100.9876, 2) truncate(100.9876, 2) | ============================ 100.98 | taos> select truncate(99999999999999.9999, 2) truncate(99999999999999.9999, 2) | =================================== 100000000000000 | taos> select truncate(-5.678, 2) truncate(-5.678, 2) | ============================ -5.67 | taos> select truncate(voltage, 2) from ts_4893.meters limit 1 truncate(voltage, 2) | ======================= 221 | taos> select truncate(current, 1) from ts_4893.meters limit 1 truncate(current, 1) | ======================= 10.6 | taos> select truncate(phase, 3) from ts_4893.meters limit 1 truncate(phase, 3) | ======================= 0.508 | taos> select truncate(voltage + current, 2) from ts_4893.meters limit 1 truncate(voltage + current, 2) | ================================= 231.64 | taos> select truncate(voltage, -1) from ts_4893.meters limit 1 truncate(voltage, -1) | ======================== 220 | taos> select round(truncate(voltage, 1), 2) from ts_4893.meters limit 1 round(truncate(voltage, 1), 2) | ================================= 221 | taos> select truncate(abs(current), 1) from ts_4893.meters limit 1 truncate(abs(current), 1) | ============================ 10.6 | taos> select truncate(exp(phase), 2) from ts_4893.meters limit 1 truncate(exp(phase), 2) | ============================ 1.66 | taos> select truncate(log(current), 1) from ts_4893.meters limit 1 truncate(log(current), 1) | ============================ 2.3 |