Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7835451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T13:38:23+00:00 2026-06-02T13:38:23+00:00

I want to export numerical data from C# to Excel where the floating point

  • 0

I want to export numerical data from C# to Excel where the floating point numbers use a comma (‘,’) for the decimal instead of the dot (‘.’). I am exporting Excel file by writing XML code in C#.

The data is properly exported from the code side, but the Excel file omits the (‘,’) if the type of data is “number”. When I generate the same data for the English language, it generates perfectly.

Example: number = 65,4 then in Excel file it shows 654.

sample code :
–xml code

 <?xml version="1.0" encoding="UTF-8" ?>
<?mso-application progid="Excel.Sheet"?>
<ss:Workbook xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
 xmlns:o="urn:schemas-microsoft-com:office:office"
 xmlns:x="urn:schemas-microsoft-com:office:excel"
 xmlns:html="http://www.w3.org/tr/rec-html40">
<ss:Worksheet ss:Name="test">
<ss:Table>
<ss:Row>
<ss:Cell ss:StyleID="s65"><ss:Data ss:Type="String">123</ss:Data></ss:Cell>
<ss:Cell ss:StyleID="s65"><ss:Data ss:Type="Number">64,3</ss:Data></ss:Cell>
<ss:Cell ss:StyleID="s65"><ss:Data ss:Type="Number">72,0</ss:Data></ss:Cell>
<ss:Cell ss:StyleID="s65"><ss:Data ss:Type="Number">26,0</ss:Data></ss:Cell>
<ss:Cell ss:StyleID="s65"><ss:Data ss:Type="Number">72,0</ss:Data></ss:Cell></ss:Row>
</ss:Table>
</ss:Worksheet></ss:Workbook>

c# code —

    Dim excelXml As String = GetExcelXml(dsInput, filename)
    Response.Clear()
    Response.AppendHeader("Cache-Control", "cache, must-revalidate")
    Response.AppendHeader("Pragma", "public")
    Response.AppendHeader("Content-Type", "application/vnd.ms-excel")
    ' Response.ContentEncoding = System.Text.Encoding.GetEncoding(1252)
    Response.Charset = "iso-8859-1"
    Response.Cache.SetCacheability(HttpCacheability.NoCache)
    Response.AppendHeader("Content-disposition", "attachment; filename=" &   
         System.IO.Path.GetFileName(filename))
    Response.Write(excelXml)
    Response.Flush()
    Response.[End]()
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T13:38:25+00:00Added an answer on June 2, 2026 at 1:38 pm

    In your code after you call GetExcelXml to read in your XML file to a string, go through the string and convert all the numbers so that the commas are periods. You should be able to do it with one line of code using Regular Expressions.

    For example, below is a line of code that will convert all the XML Number types to use the dot instead of the comma. After it’s converted write out the excelXMLCorrected to your Excel file. This function will work regardless of what language your generate your XML in:

    excelXMLCorrected = Regex.Replace(excelXml, 
       @"<ss:Data ss:Type=""Number"">([\d]+),([\d]{1})</ss:Data>", 
       "<ss:Data ss:Type=\"Number\">$1.$2</ss:Data>");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to export some data from my jruby on rails webapp to excel,
I want to export the data from a DaraGrid into an Excel file. Having
I want to export data to excel both in .xls and .xlsx format in
I want to export some SQL Server 2005 data to CSV format (comma-separated with
I want to export the results from a sproc to Excel. Thus, between the
I want to export data from one table into a new one with a
I have an excel sheet with data and want to export it to a
i want to Export MYSQL data into Excel/CSV via php. so that i can
I want to export all data from a keyspace in a cassandra cluster and
Hi I want to export my data from the data base in CSV format

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.