I have a problem with calculation like this:
? ( 2.29 * 7000 ) // = 16030
? ( 2.30 * 7000 ) // = ******* = 1.61000000000000E4
this sample is litle case,
and so many combine value in a variable return wrong result.
this problem just in FWH 64-bits version, on 32-bit version is okay.
- Code: Select all Expand view RUN
#include "fivewin.ch"
function Main()
local ar := {}
ar := { { 2.29, 7000, 0 }, ;
{ 2.30, 7000, 0 } }
? ( 2.29 * 7000 ) // = 16030
? ( 2.30 * 7000 ) // = ******* = 1.61000000000000E4
aEval( aR, {|e| e[3] := e[1] * e[2] })
Browse1( aR )
return nil
function Browse1( uSource )
local oDlg, oBar, oFont, oBrw
local bRowCalc
DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
DEFINE DIALOG oDlg SIZE 400,500 PIXEL TRUEPIXEL FONT oFont
DEFINE BUTTONBAR oBar OF oDlg SIZE 80,32 2015
@ 50,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
DATASOURCE uSource AUTOCOLS ;
headers "Qty", "Price", "Totals" ;
pictures "999,999.99", "999,999,999.99", "999,999,999,999.99" ;
COLSIZES 60, 90, 130 ;
CELL LINES NOBORDER FOOTERS FASTEDIT
bRowCalc := { || oBrw:Totals:Value := oBrw:Qty:Value * oBrw:Price:Value }
WITH OBJECT oBrw
WITH OBJECT oBrw:Qty
:nEditType := EDIT_GET
:bOnChange := bRowCalc
END
WITH OBJECT oBrw:Price
:nEditType := EDIT_GET
:bOnChange := bRowCalc
:cFooter := "Total..."
END
:Totals:nFooterType := AGGR_SUM
:lHScroll := .f.
:MakeTotals()
:CreateFromCode()
END
DEFINE BUTTON OF oBar PROMPT "Close" CENTER ACTION oDlg:End()
ACTIVATE DIALOG oDlg CENTERED
RELEASE FONT oFont
return nil