Re: Working with floating point values



Thanks-- I'd thought about that, but I need to maintain the values as
doubles. And the time it would take to convert to string, then back to
double, would slow my calculations down noticeably.

"ranjeet" <ranjeet.athwal@xxxxxxxxx> wrote in message
news:opsu8u7hmzlvhghh@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> you could format the number like
> String.Format("{0:#,##0.00;#,##0.00;0.00}", myDecimal.ToString()) ;
> (assuming you want a string at the end)
>
> Ranjeet.


.



Relevant Pages

  • Re: conversion of types.
    ... I am reading the whole row as a string using fgets. ... I might write doubles to a binary file where each double is eight bytes long. ... You need to delimit the values with an 'out-of-bound' character like '|' or something. ... You have to know the format of the file you are reading. ...
    (comp.lang.c)
  • Double.ToString round-trip: "R" vs. "G17"
    ... and therefore the doubles have to be represented as strings. ... We also need to be able to take the XML back from the browser and parse the ... decimal string representation, but at this point it would be a major ... as the original double, it's done, otherwise output it with 17 decimals. ...
    (microsoft.public.dotnet.framework.clr)
  • Re: socket communication: send & receive doesnt work right
    ... So I don't want to send a string as bytes. ... I did a test of sending two doubles: ... public void send_doubles(double vals, int len) throws ... char *result; ...
    (microsoft.public.win32.programmer.networks)
  • Re: [PHP] Re: optimilize web page loading
    ... doubles for the email. ... Philip Thompson wrote: ... the PHP parser doesn't have to evaluate ... this string to determine if anything needs to be translated (e.g., ...
    (php.general)
  • Re: [PHP] Re: optimilize web page loading
    ... doubles for the email. ... Philip Thompson wrote: ... the PHP parser doesn't have to evaluate ... this string to determine if anything needs to be translated (e.g., ...
    (php.general)