Click here to Skip to main content
15,903,203 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
SELECT ROUND(123.89, -1)

reply this query urgent
Posted

second argument is -1 means rounding by 10..
so result will be from series 10,20,30...100,110,120....

here 123 is near to 120 and 127 is near to 130

SQL
SELECT ROUND(123.89, -1) [123 is near 120], ROUND(127.89, -1) [127 is near 130]
--means rounding by 10

same way if second argument is -2 means rounding by 100
so result will be from series 100,200,300...1000,1100,1200....

Happy Coding!
:)
 
Share this answer
 
SELECT ROUND(123.89, -1)


Result:120.00

SELECT ROUND(123.89, 0)

Result:124.00

SELECT ROUND(123.89, 1)

Result:123.90

By this Example 2nd argument -1 is used to pointing the Position of Round of.
123.89 is near to 120
125 is 130
 
Share this answer
 
Hi,

ROUND() used to round a numeric field to the number of decimals specified

Regards
 
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