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

  • SEARCH
  • Home
  • 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 7864943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T23:56:26+00:00 2026-06-02T23:56:26+00:00

I am copying a value 8.03 from excel sheet and reading that value in

  • 0

I am copying a value 8.03 from excel sheet and reading that value in C# from the clipboard using the code below. The value that is coming out is 8.0299999999999994 and not 8.03. When I look at the xml as in below the value is 8.0299999999999994. The sheet1.xml which is in the zip file of xlsx also has the value 8.02999999999999994. But when I copy the value to notepad the value gets copied at 8.03. What can I do to copy the value as 8.03 like in notepad?

DataObject retrievedData =  Clipboard.GetDataObject() as DataObject;
    if (retrievedData.GetDataPresent("XML Spreadsheet"))
    {
        var sourceDataReader = new XmlTextReader(retrievedData.GetData("XML Spreadsheet") as System.IO.Stream);
         var doc = XDocument.Load(reader);
         var excelWorksheeet = doc.Element("Worksheet");
         XNamespace ns = "urn:schemas-microsoft-com:office:spreadsheet";
         XName worksheetName = ns + "Worksheet";
         var worksheetElement = doc.Root.Element(worksheetName);
    }

The worksheetElement has the value:

 <Worksheet ss:Name="Sheet1" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns="urn:schemas-microsoft-com:office:spreadsheet">
   <Table ss:ExpandedColumnCount="1" ss:ExpandedRowCount="1" ss:DefaultRowHeight="15">
     <Row>
       <Cell>
         <Data ss:Type="Number">8.0299999999999994</Data> 
       </Cell>
      </Row>
    </Table>
  </Worksheet>
  • 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-02T23:56:27+00:00Added an answer on June 2, 2026 at 11:56 pm

    The clipboard has support for several formats. Obviously the XML Spreadsheet format does a different rounding of the underlying float value than excel does. If you want to get the data exactly as notepad does, try to get the text representation instead.

    Of course, copying as text will not get all the detailed information that XML Spreadsheet gives you, but it all depends on what you want to do with the data.

    An alternative is to get both representations. Get the XML Spreadsheet format to get the detailed data and use the text format to get a display string.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Excel macro that is copying all of the information from a
I am copying code from website matplotlib and pasting into the Vim editor in
I'm having trouble copying a row from one table to another using sqlite3 in
I am copying data from MS Access to SQL Server using SSIS. Only one
Coming from C#, where class instances are passed by reference (that is, a copy
I am copying the select tag from playframework to test out creating tags as
So, copying the code from Introduction to Compiler Construction in Unix I wind up
I'm copying an NSString from an NSDictionary into a local NSString using [[NSString alloc]
I am copying data from a table created by an Excel spreadsheet import. Here
Copying a File using a straight-forward approach in Python is typically like this: def

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.