Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我记得以前这样做,但我不记得我是怎么做到的,所以想知道是否有人可以请赐教?
默认情况下,您通常会获得分数14.9236183166504,例如;我怎样才能将它修剪到只有 2 个小数点或根本没有?
14.9236183166504
分数只是一个浮点数,因此您可以使用round; 例如,如果您想要两位小数:
round
select round(match(x) against('y'), 2) as n from ...
如果你不想要:
select round(match(x) against('y')) as n from ...
还有floor,ceil如果您要在分数的任一侧查找整数,或者truncate您想要截断浮点值而不是舍入它。
floor
ceil
truncate