johnnymagee69
Programmer
Hi,
I have to re-create in SQL a custom Excel function which rounds numbers to 8 significant figures (because thats how many digits can be shown on a calculator!). I can work out the number of decimal points correctly but the round() function then rounds down when called in a procedure instead of up as it does normally when the digit to truncate is 5. All numbers are type decimal(38,33).
eg
The number to round up is 20.6348035.
When called in a procedure: round(20.6348035,6)=20.6348030 but outside of a procedure: round(20.6348035,6)=20.6348040
Any help appreciated.
Ta
I have to re-create in SQL a custom Excel function which rounds numbers to 8 significant figures (because thats how many digits can be shown on a calculator!). I can work out the number of decimal points correctly but the round() function then rounds down when called in a procedure instead of up as it does normally when the digit to truncate is 5. All numbers are type decimal(38,33).
eg
The number to round up is 20.6348035.
When called in a procedure: round(20.6348035,6)=20.6348030 but outside of a procedure: round(20.6348035,6)=20.6348040
Any help appreciated.
Ta