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 9178253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:30:32+00:00 2026-06-17T17:30:32+00:00

I am trying to convert a double with 12 decimal places to a string,

  • 0

I am trying to convert a double with 12 decimal places to a string, but it only returns a string with 10 decimal places.

I have tried ToString, Format, FormatNumber, CStr and System.Convert.ToString. They all return 10 decimal places.

(Also same behavior with the decimal data type)

Example:

d = Date.Parse(sDate).ToOADate (value is 41261.001388888886)

d.ToString = 41261.0013888889

CStr(d) = 41261.0013888889

FormatNumber(d, 12) = 41,261.001388888900

In the case of Format and FormatNumber, when 12 places are specified, the value is rounded of to 10 digits.

This cropped up when I constructed a Filter for a DataView object.

Is there a way around this or is this a limitation in .Net?

  • 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-17T17:30:33+00:00Added an answer on June 17, 2026 at 5:30 pm

    Double.ToString uses only 15 digit precision.

    You should use d.ToString("R")

    From MSDN:

    The round-trip (“R”) format specifier guarantees that a numeric value that is converted to a string will be parsed back into the same numeric value.

    …

    When a Single or Double value is formatted using this specifier, it is first tested using the general format, with 15 digits of precision for a Double and 7 digits of precision for a Single. If the value is successfully parsed back to the same numeric value, it is formatted using the general format specifier. If the value is not successfully parsed back to the same numeric value, it is formatted using 17 digits of precision for a Double and 9 digits of precision for a Single.

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

Sidebar

Related Questions

I'm trying to convert std::string to float/double . I tried: std::string num = 0.6;
I have a double and i am trying to convert it to a decimal.
I am trying to convert string to double. But i am getting the number
I'm trying to convert a double to a string without notation, and tried this:
I am trying to convert a string to a double. The code is very
I am trying to convert a string to a double value to use it
I am trying to convert a double to a decimal using Convert.ToDecimal function. The
i am trying to convert double to pascal real but when i convert 0.23
I am trying to convert a double to a little-Endian hex string or directly
i am trying to convert a string to a double. I was able to

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.