xBrowse: Avoid long numbers converted to scientific notation

Post Reply
hua
Posts: 861
Joined: Fri Oct 28, 2005 2:27 am

xBrowse: Avoid long numbers converted to scientific notation

Post by hua »

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?

Image


TIA

p.s. I just noticed all the numbers in "Inv Num." column are converted to 1.192E+11
FWH 11.08/FWH 19.03
xHarbour 1.2.1 (Rev 6406) + BCC
Harbour 3.1 (Rev 17062) + BCC
Harbour 3.2.0dev (r1904111533) + BCC
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: xBrowse: Avoid long numbers converted to scientific notation

Post by nageswaragunupudi »

Is this a browse from Array or DBF?

For now, please do this.
Have a function like this

Code: Select all

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
hua
Posts: 861
Joined: Fri Oct 28, 2005 2:27 am

Re: xBrowse: Avoid long numbers converted to scientific notation

Post by hua »

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: Select all

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.03
xHarbour 1.2.1 (Rev 6406) + BCC
Harbour 3.1 (Rev 17062) + BCC
Harbour 3.2.0dev (r1904111533) + BCC
Post Reply