FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour FWH 18.01 & xBrowse numeric display
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
FWH 18.01 & xBrowse numeric display
Posted: Wed Feb 21, 2018 10:58 PM
I have found an interesting problem with the xBrowse display of numeric data.

Here is the code used for the browse:

Code (fw): Select all Collapse
    // 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.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 187
Joined: Mon Oct 20, 2008 06:33 PM
Re: FWH 18.01 & xBrowse numeric display
Posted: Fri Feb 23, 2018 02:57 PM

I have the same problem.

Has anyone found the solution?

Thanks.

Oscar Ribeiro

OASyS Informática

Fwh18.02 + xHarbour 1.2.3 + Bcc72
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: FWH 18.01 & xBrowse numeric display
Posted: Fri Feb 23, 2018 10:13 PM
Please make the following correction in
\fwh\source\function\valtostr.prg ( lines 116 to 128 )

This is the existing code:
Code (fw): Select all Collapse
   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 (fw): Select all Collapse
   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
*/
Regards



G. N. Rao.

Hyderabad, India
Posts: 187
Joined: Mon Oct 20, 2008 06:33 PM
Re: FWH 18.01 & xBrowse numeric display
Posted: Fri Feb 23, 2018 11:13 PM

Thanks Rao

Oscar Ribeiro

OASyS Informática

Fwh18.02 + xHarbour 1.2.3 + Bcc72

Continue the discussion