Click here to Skip to main content
15,890,123 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi
I have problem in rounding the number with decimal

search result I only got the following answer.
select round(1.12,1) it takes as 1.10.
select round(1.15,1) it takes as 1.20.

But I need the result like below.

Ex: 12.34 = 12.30
Ex: 12.35 = 12.35
Ex: 12.36 = 12.40
Ex: 12.95 = 12.95
Ex: 12.96 =13.00

Pls help me

Maideen
Posted
Comments
PIEBALDconsult 6-Jul-15 20:23pm    
A few examples makes it look like you can multiply by 2, round, then divide by 2. See how that works for you.
Maideen Abdul Kader 6-Jul-15 20:42pm    
thank
By using your advice
If I round
12.31 / 12.32 goes to 12.30
12.33 / 12.34 / 12.35 / 12.36 / 12.37 goes to 12.35
12.38 / 12.39 goes to 12.40
I think so, sounds good. in Cents, not so much lose or gain. Thank you.
Maideen Abdul Kader 6-Jul-15 20:45pm    
Hi
I do not have option "Answered" Previously I got. any issue site?
Sergey Alexandrovich Kryukov 6-Jul-15 21:23pm    
Would you explain why rounding a number? I'm serious. The answer will depend on that.
—SA
Maideen Abdul Kader 6-Jul-15 21:31pm    
In our country, GST has been implemented just 2 month before. Our Govt want to round up 5 and 10 cents. because we do not have 1 cents and 2 cents in coin. that why i need. Anyway credit goes to PIEBALD

maideen

1 solution

Try :
SQL
select round(1.12*10,1)/10
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900