Page 1 of 1

xBrowse: Avoid long numbers converted to scientific notation

Posted: Sat May 02, 2020 8:18 pm
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

Re: xBrowse: Avoid long numbers converted to scientific notation

Posted: Sun May 03, 2020 7:55 am
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 )

Re: xBrowse: Avoid long numbers converted to scientific notation

Posted: Sun May 03, 2020 12:46 pm
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!