Select first n significant figures in a number SQL
I have a requirement as per which I need to select the first n significant figures in a number regardless of the position of decimal. The normal rounding off rules should apply.
Example- For 5 significant digits
- 12.3000000 should give 12.3 (or 12.300)
- 0.000123453 should give 0.00012345
- 0.000123456 should give 0.00012346
Please can someone suggest an approach to achieve this.
Thanks,
Abhishek Chauhan