ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Export asp to excel Format number (https://www.excelbanter.com/excel-programming/318039-export-asp-excel-format-number.html)

Lilia

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



Stephen Knapp

Export asp to excel Format number
 
You posted this question on 11/30/2004 and it appears as though no one
responded to your inquiry. If you are still attempting to solve the problem
of "Export asp to excel Format number", then re-post your question in this
NewsGroup and one of us will take a fresh look at it. On your original
posting, you should click the YES or NO buttons to close out that entry on
the system.

Steve in Ohio


"Lilia" wrote:

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




All times are GMT +1. The time now is 07:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com