SQL Server supports formats float data type without trailing zeros, so you can remove trailing zeroes by casting the to a float. For example:
Select Cast(10.40000 as float)
This returns 10.4
However, this is a presentation issue and really should be done in your presentation layer instead of wasting resources casting to different data types.