SELECT 1 / 10                         AS VAL1 -- 整型 -- 0
     , 1 / 10.0                       AS VAL2 -- 浮点型 -- 0.100000
     , CAST(12.345 AS DECIMAL(18, 2)) AS VAL3 -- 小数位数 -- 12.35
     , CEILING(12.345)                AS VAL4 -- 向上取整 -- 13
     , FLOOR(12.345)                  AS VAL5 -- 向下取整 -- 12
     , ROUND(12.345, 2)               AS VAL6 -- 四舍五入 -- 12.350
     , ROUND(12.345, 2, 1)            AS VAL7 -- 向下取舍 -- 12.340

sqlserver mssql 小数



Copyright © 2006-2020 quping.com, All rights reserved. 鲁ICP备09092435号-1

QQ 微信