Page 1 of 1

FWH 18.01 & xBrowse numeric display

PostPosted: Wed Feb 21, 2018 10:58 pm
by TimStone
I have found an interesting problem with the xBrowse display of numeric data.

Here is the code used for the browse:

Code: Select all  Expand view

    // Create the browse control
    REDEFINE  XBROWSE oLbx09 ;
      DATASOURCE oEditWork:oWorkRevise ;
      ID 605 OF oDre ;
      HEADERS " Date ", " Time ", " Previous ", " Add ", " New Total ", " Shop Rep ", " Contacted ", " " ;
      COLUMNS "revdat", "revtim", "revold", "(revold + revamt )", "revrep", "revcnt", " " ;
      JUSTIFY 2,2 ;
      ON CHANGE  ( nRevTot := oEditWork:oWorkRevise:revold + oEditWork:oWorkRevise:revamt, oDre:update() ) ;
      UPDATE

    // Provide the header gradient
    oLbx09:bClrGrad := aPubGrad
    // Set the styles
    oLbx09:nMarqueeStyle := MARQSTYLE_HIGHLROW
    oLbx09:nColDividerStyle := LINESTYLE_RAISED
    oLbx09:nRowDividerStyle := LINESTYLE_RAISED
    oLbx09:nHeadStrAligns  := AL_CENTER
    oLbx09:nStretchCol := STRETCHCOL_LAST
 


revold is 0.00
revamp is 574.71
the xbrowse shows revold + revamt as 574.7100000000000036

I had this in another xbrowse also where I had to specify a PICTURE clause plus a size for the field. In that case it was displaying a column with numeric data stored in a .dbf with a structure of N. 12,2

This is a new issue not found in any previous version of xBrowse, but clearly in FWH 18.01.

Re: FWH 18.01 & xBrowse numeric display

PostPosted: Fri Feb 23, 2018 2:57 pm
by ORibeiro
I have the same problem.

Has anyone found the solution?

Thanks.

Re: FWH 18.01 & xBrowse numeric display

PostPosted: Fri Feb 23, 2018 10:13 pm
by nageswaragunupudi
Please make the following correction in
\fwh\source\function\valtostr.prg ( lines 116 to 128 )

This is the existing code:
Code: Select all  Expand view
  elseif Empty( cPic )
/*
      if ValType( uVal ) == 'N' .and. cInternational == 'E'
         cVal     := Transform( uVal, '@E' )
      else
         cVal     := cValToChar( uVal )
      endif
*/

      if ValType( uVal ) == 'N'
         cVal     := cNumToStr( uVal, cInternational == 'E' )
      else
         cVal     := cValToChar( uVal )
      endif
 


Please change it as:
Code: Select all  Expand view
  elseif Empty( cPic )

      if ValType( uVal ) == 'N' .and. cInternational == 'E'
         cVal     := Transform( uVal, '@E' )
      else
         cVal     := cValToChar( uVal )
      endif

/*
      if ValType( uVal ) == 'N'
         cVal     := cNumToStr( uVal, cInternational == 'E' )
      else
         cVal     := cValToChar( uVal )
      endif
*/

 

Re: FWH 18.01 & xBrowse numeric display

PostPosted: Fri Feb 23, 2018 11:13 pm
by ORibeiro
Thanks Rao