开发者

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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜