我已经尝试了以下方法:
discval = 2.833423
discval = discval.toFixed(2).toString().replace("." , ",");
discval = parseFloat(discval);
Run Code Online (Sandbox Code Playgroud)
输出是 2 而不是 2,83
任何的想法?
我试图使用while循环更新mtrl表,@@fetch_status但它看起来发生了一些事情并且存在无限循环.
当我在SQL Server中运行以下代码时,它会卡住.
什么出了什么问题?
USE [TEST_DB]
GO
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
GO
BEGIN
declare @iteid int;
SET NOCOUNT ON;
Declare items cursor for
select mtrl
from mtrl
where sodtype = 51 and company = 1 and socurrency = 1;
open items;
fetch next from items into @iteid;
while @@fetch_status = 0
begin
update mtrl
set pricer = 2
where mtrl = @iteid;
end
close items;
deallocate items;
END
GO
Run Code Online (Sandbox Code Playgroud)