以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 请教,手机数值框显示问题。 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=140698) |
-- 作者:wandongliang -- 发布时间:2019/9/11 16:53:00 -- 请教,手机数值框显示问题。 后台数据金额列,双精度小数,值72.9,调入手机数值框,却变成了72.9000015258789 请教各位老师,这是怎么回事?
|
-- 作者:有点蓝 -- 发布时间:2019/9/11 16:56:00 -- 贴出代码 |
-- 作者:wandongliang -- 发布时间:2019/9/11 16:59:00 -- If e.postvalues.ContainsKey("jhsl")Then Dim shl As Integer = Tables("出入库总表").current("商品数量") Dim jine As Double = Tables("出入库总表").current("实付款金额") DataTables("出入库明细表").LoadFilter = "单据编号 = \'"& Tables("出入库总表").current("单据编号") & "\'" With wb.AddPanelGroup("form1","pg1","已入库商品明细") For Each ms As DataRow In DataTables("出入库明细表").datarows If ms("单据编号") = Tables("出入库总表").current("单据编号") Then Dim ko As String = "进货数量:" & ms("数量") & "开票价:" & ms("开票单价") & "优惠价格:" & ms("优惠金额") Dim kk As String = "总计金额:" & ms("实付金额") With .Add(ms("_Identify"),ms("商品名称"),ko,"./images/button.png","http://www.foxtable.com") \'超链接 .AddFoot(kk) End With End If Next End With With wb.AddInputGroup("form1","ipg10","进货单汇总") With .AddInput("合计数量","合计数量","text") .value = "总计:" & shl & "件" End With With .AddInput("合计金额","合计金额","text") .value = "总计:" & jine & "元" End With .AddInput("总单优惠","总单优惠","number") End With |
-- 作者:wandongliang -- 发布时间:2019/9/11 16:59:00 -- 合计金额 输入框出现的问题 |
-- 作者:有点蓝 -- 发布时间:2019/9/11 17:15:00 -- 试试 或者 Dim jine As Decimal = Tables("出入库总表").current("实付款金额")
|
-- 作者:wandongliang -- 发布时间:2019/9/11 17:25:00 -- 蓝老师,第一种方式报错“需要声明round” ,第二种方式可以。 另外,还一个地方,三个数值框,“开票价格”,“进货数量”,“总计金额” 总计金额,通过JS有开票价格,进货数量计算得出。当开票价格为8.1,进货数量为9 的时候,总计金额变成了72.899999999999 以下是代码: With wb.AddInputGroup("form2","ipg2","正在入库商品……") With .addTextArea("商品名称",2) .value = bb("商品名称") End With With .AddInput("kpjg","开票价格","number") .Attribute = "" .Step = 0.1 End With .AddInput("jhsl","进货数量","number").Attribute = "" With .AddInput("zjje","总计金额","number") .Step = 0.1 End With .AddInput("yhje","优惠金额","number").Attribute = "" End With js代码 function alc(){ zjje.value=kpjg.value * jhsl.value - yhje.value; } |
-- 作者:有点蓝 -- 发布时间:2019/9/11 17:38:00 -- Dim jine As Double = Round2(Tables("出入库总表").current("实付款金额"),2) 代码全部改为使用Decimal
|