嗨,我住在奥地利,我们使用,
小数点分隔符。
根据语言/排序规则设置,使用正确的分隔符将浮点数转换为 varchar 似乎是不可能的?
这是一个错误吗?
set language german --makes no difference in this case
declare @f float = 4.5
select @f --output in my management studio is 4,5
--according to the regional os settings this is correct
select convert(varchar,@f) -- output: 4.5 not correct
一种解决方案,但我认为并不理想
select replace(convert(varchar,@f),'.',',')