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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T23:24:28+00:00 2026-06-09T23:24:28+00:00

I am trying to output flouting point numbers from c# in the format used

  • 0

I am trying to output flouting point numbers from c# in the format used by VRML 2.0.

According to the vrml spec, this is

double-precision floating point number in IEEE 1xxx floating point
format (see 2.[IEEE]).

[IEEE]: ISO/IEC 9899:1990 Programming languages — C.
http://www.iso.ch/isob/switch-engine-cate.pl?searchtype=refnumber&KEYWORDS=9899
(dead link)

  • what is the correct string representation for this format? I am having trouble finding a reference. I found several explanations about the binary representation, but none about the string representation.
  • how can I configure a NumberFormatInfo or a CultureInfo in accordance with this format?

clarification:

I want to produce a vrml file and I need to know how to assure

var myCultureInfo = CultureInfo.InvariantCulture;
myCultureInfo.NumberFormat = ....
StringWriter sw = new StringWriter(MyCultureInfo)
sw.Write(myDouble);

will result in a number that is 100% in accordance to the vrml spezification.

  • 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-09T23:24:30+00:00Added an answer on June 9, 2026 at 11:24 pm

    I saw somewhere that VRML uses the same format for floating-point numbers as ISO C. Even the VRML spec page that you’re mentioning hints at that:

    The SFFloat field specifies one single-precision floating point number. MFFloat specifies zero or more single-precision floating point numbers. SFFloats and MFFloats are written to the VRML file in IEEE 1xxx floating point format (see 2.[IEEE]).

    Note where that hyperlink points to: to the bibliography entry for ISO C.

    So you should get the proper format if you simply disable any culture-specific formatting (such as special decimal points, characters that separate blocks of three digits each, etc.). You do this by using the “invariant culture”:

    double number = …;
    string numberEncoding = number.ToString(CultureInfo.InvariantCulture.NumberFormat);
    

    See also Standard Numeric Format Strings if you want to control the output format of the number, e.g.

    • for the scientific format:

      number.ToString("E", CultureInfo.InvariantCulture.NumberFormat)
      
    • for the round-trip format:

      number.ToString("R", CultureInfo.InvariantCulture.NumberFormat)
      

    …and so on.

    P.S.: If you don’t quite trust that the invariant culture will be exactly the right match, you could always create your own instance of NumberFormatInfo:

    var vrmlNumberFormat = new NumberFormatInfo { NumberDecimalSeparator = ".", … };
    string numberEncoding = number.ToString(vrmlNumberFormat);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to output unicode string into RTF format. (using c# and winforms) From
I'm trying to understand a paper on lossless compression of floating point numbers and
I've run into this problem before, but with floating point numbers. Similar to this
I have a file numbers.dat containing about 300 numbers(floating point,negative positive)in column format. The
I am trying to output dates in the Italian format using date() as follows:
I'm trying to output the hex value of a char and format it in
I am trying to output POST-data that I send from an android phone, however
I'm trying to read a texture that's been loaded with floating-point values using my
I am trying to output the text from xml through an html file.Xml file
I trying to output a list of todo items from the Mac app Things

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.