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.
例如,我有 1000 个西红柿,总价值 4.00 美元。这将是0.004每个番茄。我的数据类型是decimal (9,2).
0.004
decimal (9,2)
如果我想将该值四舍五入,0.01我将如何实现?
0.01
Select Round(CEILING(0.004 * 100)/100,2)
select case when cast(4.00/1000 as decimal(9,2)) < 0.01 then 0.01 else cast(4.00/1000 as decimal(9,2)) end
这应该这样做:
select ceiling(0.004*100)/100