Convert int to truncated decimal
How do I convert 51501319
to 51.5
开发者_StackOverflow中文版? (needs to round to .5
)
Thanks!
Select Round( 51501319 / 1000000.000, 1 )
Try this:
SELECT CAST( CAST(51501319 AS decimal(10,1)) / 1000000 AS decimal(10,1))
SELECT ROUND( (1.0*5150319)/100000, 1)
This will get 51.5 but is this really what you want? What should it do with 5159999? Do you want 51.5 or 51.6, or 52.0?
精彩评论