简体   繁体   English

我在 SQL 中厌倦了 round(7.285,-2)。'-' 符号的意义是什么?

[英]i tired round(7.285,-2) in SQL. What is the significance of '-' sign?

round(7.285,-2) gave the output as 7.0 Can anyone pls explain how the output got generated? round(7.285,-2) 将 output 设为 7.0 谁能解释一下 output 是如何生成的?

round(7.285,-2);

output: 7.0 output:7.0

why are you using -2你为什么用-2
just use round(7.285) you will get 7.0 as output by using -2 it will check up to 2 digits before the decimal suppose u have a value 117.285 bu using -2 you will get 100.0 and by using +2 in 7.285 you will get output 7.29只需使用round(7.285)你将得到 7.0 作为 output 通过使用 -2 它将检查小数点前最多 2 位数字假设你有一个值 117.285 bu 使用 -2 你将得到 100.0 并且通过在 7.285 中使用 +2 你将得到output 7.29

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM