FWH 18.01 & xBrowse numeric display

Post Reply
User avatar
TimStone
Posts: 2956
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Has thanked: 25 times
Been thanked: 2 times
Contact:

FWH 18.01 & xBrowse numeric display

Post 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


    // 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
User avatar
ORibeiro
Posts: 187
Joined: Mon Oct 20, 2008 6:33 pm
Location: Itu, Sao Paulo, Brazil

Re: FWH 18.01 & xBrowse numeric display

Post by ORibeiro »

I have the same problem.

Has anyone found the solution?

Thanks.
Oscar Ribeiro
OASyS Informática
Fwh18.02 + xHarbour 1.2.3 + Bcc72
User avatar
nageswaragunupudi
Posts: 10729
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 10 times
Contact:

Re: FWH 18.01 & xBrowse numeric display

Post 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

  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

  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
User avatar
ORibeiro
Posts: 187
Joined: Mon Oct 20, 2008 6:33 pm
Location: Itu, Sao Paulo, Brazil

Re: FWH 18.01 & xBrowse numeric display

Post by ORibeiro »

Thanks Rao
Oscar Ribeiro
OASyS Informática
Fwh18.02 + xHarbour 1.2.3 + Bcc72
Post Reply