Hello I am coming from Bosnia and Herzegovina and in our county the smallest note bill is 0.05, Now the government pushing us to our retrial prices rounding on 0.05 or at 0.00. Therefor I want to create SQL Scalar Valued Function for rounding the prices on given value. Is there some build in solution so I can save resource of my queries. Thanx in advice Best regards
Edit from comment:
- 0,1,2,3,4 go to zero
- 5,6,7,8,9 going to zero+1
Thanks to marc_s, i changed to money datatype.
float vs decimal vs money datatype article and flowchart
There's nothing built-in - but it's easy enough to create:
EDIT : adapted to your special rounding needs :-)
Use the DECIMAL or MONEY data type - whatever suits you best.
Use it like this:
Which gives you 1.50, 1.50, 7.30, 7.40, 7.40 as results.
Marc