Exporting data to excel with specific decimals

ramsay18477ramsay18477 Member Posts: 52
Hi All,

When I export numeric data to excel, I use 'format' to convert it to text format before the transfer.

But, when the data is exported to excel, it does not display the trailing zeros in the decimals, which I want it to.

For eg., if the value '31.50', data in excel is shown as '31.5', while I want it to be shown as '31.50'.

Please advise.
Thanks & Best Regards,

Ram.

Comments

  • NagiNagi Member Posts: 151
    Hello Ramsay18477,

    Assuming you're using ExcelBuffer, then you don't need to format your decimal value to text. This will remove your ,00 decimals.

    You can also set specific number formats to further control this issue. Heres's an example. You can right click cells in Excel and choose Format Cells -> Custom format to see more examples to play around with.
    ExcelBuf.AddColumn(MyDecimalValue,FALSE,'',FALSE,FALSE,FALSE,'#.##0,00');
    
  • DeepDeep Member Posts: 569
    You can format the numbers in Excel by right clicking the cells, choosiong format sells>number and then selecting the decimal places.
    Regards,

    Deep
    India
Sign In or Register to comment.