SDU Tools: Truncate trailing zeroes in SQL Server T-SQL
Often when I convert a decimal number to a string in T-SQL, I want the simplest version of the number. I really don’t want any trailing zeroes (i.e. at the end of the number).
In our free SDU Tools for developers and DBAs, we added a function to do just that: TruncateTrailingZeroes.
The function just takes one parameter: the number to be processed.
You can use our tools as a set or as a great example of how to write functions like these.
2019-11-20