FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour xBrowse: Avoid long numbers converted to scientific notation
Posts: 1096
Joined: Fri Oct 28, 2005 02:27 AM
xBrowse: Avoid long numbers converted to scientific notation
Posted: Sat May 02, 2020 08:18 PM
Hi,
I have a col with long numbers, e.g. 119200075708
After exporting to excel from xbrowser, it ends up as 1.192E+11
How to prevent that from happening?




TIA

p.s. I just noticed all the numbers in "Inv Num." column are converted to 1.192E+11
FWH 11.08/FWH 19.12

BCC5.82/BCC7.3

xHarbour/Harbour
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xBrowse: Avoid long numbers converted to scientific notation
Posted: Sun May 03, 2020 07:55 AM
Is this a browse from Array or DBF?

For now, please do this.
Have a function like this
Code (fw): Select all Collapse
function myexcel( oBrw )
      local oSheet
      oSheet := oBrw:ToExcel()
      oSheet:Columns( 1 ):NumberFormat := "#########"
      return nil


Instead of calling oBrw:ToExcel(), please call myexcel( oBrw )
Regards



G. N. Rao.

Hyderabad, India
Posts: 1096
Joined: Fri Oct 28, 2005 02:27 AM
Re: xBrowse: Avoid long numbers converted to scientific notation
Posted: Sun May 03, 2020 12:46 PM
nageswaragunupudi wrote:Is this a browse from Array or DBF?

From an array which gets its contents from a csv file


For now, please do this.
Have a function like this
Code (fw): Select all Collapse
function myexcel( oBrw )
      local oSheet
      oSheet := oBrw:ToExcel()
      oSheet:Columns( 1 ):NumberFormat := "#########"
      return nil


Instead of calling oBrw:ToExcel(), please call myexcel( oBrw )


It works!
Thanks Rao!
FWH 11.08/FWH 19.12

BCC5.82/BCC7.3

xHarbour/Harbour

Continue the discussion