View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Lilia Lilia is offline
external usenet poster
 
Posts: 1
Default Export asp to excel Format number

Hello
I am using asp for my page of prices and I am exporting the data and
Image(OWC) to EXCEL.
I need to export the data with number format with two decimals and i need to
make calculations or operations with the numbers exported in excel.
First I used the following code:
<TD STYLE="vnd.ms-excel.numberformat:#,##0.00<%=RS2("PRECIO")% &nsbsp;</TD

but, it exports 34,1 29,04 it doesn't respect the format of two decimals, it
omits the zeros and I cannot make operations for the coma.

Then I made a test with the following code:
<TD <%=Response.write
Replace(FormatNumber(RS2("PRECIO"),2,-1,-1,0),",","."%</TD

I use the replace to put point instead of comas, since excel only can make
operations with points.
This last code show me perfectly the format like I need it, 22.01 22.00
22.01 but I can not make operations in excel.

it exports it to me as text, and I need it as number.

Thanks

an excuse for my English