Philippe
Philippe

Reputation: 73

Rounding up with two decimal places usind SQL

I want to a number like 3.5212, becomes 3.53. But using:

select Ceiling(3.5212) 

it returns 4.

Can I make it always round up with two decimal places?

Upvotes: 0

Views: 1057

Answers (1)

zarruq
zarruq

Reputation: 2465

One way could be to multiply the value by 100 before ceiling function and then divide the final value by 100 as below.

select Ceiling(3.5212 * 100) / 100

Result:

VAL
--------
3.530000

DEMO

Upvotes: 3

Related Questions