d7+access 2003 双精度数相除之后为什么只保留整数位了?
代码如下:
//我是从人民币价格,根据汇率表计算台币、美元价格with datamd.ADOCalculateTemp do begin close; sql.Clear; sql.Text := 'update t_productCost t1,t_exchangeRate t2 set FTotalCostNTD=FTotalCostRMB*FNTDtoRMB,FTotalCostUSD=FTotalCostRMB\FUSDtoRMB '; //美元价格计算出来后全只保留整数位,各币种价格数据类型都是双精度,小数位数是6 sql.Text := sql.Text + ' where t1.fyear = t2.fyear and t1.fperiod = t2.fperiod '; showmessage(sql.text); execSql; end;
--价格表:--RMB NTD USD--0.374706 ? ?--汇率表: NTDtoRMB=4.5 USDtoRMB=6.5