public static String toString(double d)
Creates a string representation of the double argument. All characters
mentioned below are ASCII characters.
If the argument is NaN, the result is the string "NaN".
Otherwise, the result is a string that represents the sign and magnitude
(absolute value) of the argument. If the sign is negative, the first
character of the result is '-' ('-'); if the sign is positive, no sign
character appears in the result. As for the magnitude m:
If m is infinity, it is represented by the characters "Infinity"; thus,
positive infinity produces the result "Infinity" and negative infinity
produces the result "-Infinity".
If m is zero, it is represented by the characters "0.0"; thus, negative zero
produces the result "-0.0" and positive zero produces the result "0.0".
If m is greater than or equal to 10-3 but less than 107, then it is
represented as the integer part of m, in decimal form with no leading
zeroes, followed by '.' (.), followed by one or more decimal digits
representing the fractional part of m.
If m is less than 10-3 or not less than 107, then it is represented in
so-called "computerized scientific notation." Let n be the unique integer
such that 10n<=m<10n; then let a be the mathematically exact quotient of m
and 10n so that 1<=a<10. The magnitude is then represented as the integer
part of a, as a single decimal digit, followed by '.' (.), followed by
decimal digits representing the fractional part of a, followed by the letter
'E' (E), followed by a representation of n as a decimal integer, as produced
by the method Integer.toString(int).
How many digits must be printed for the fractional part of m or a? There
must be at least one digit to represent the fractional part, and beyond that
as many, but only as many, more digits as are needed to uniquely distinguish
the argument value from adjacent values of type double. That is, suppose
that x is the exact mathematical value represented by the decimal
representation produced by this method for a finite nonzero argument d. Then
d must be the double value nearest to x; or if two double values are equally
close to x, then d must be one of them and the least significant bit of the
significand of d must be 0.
Parameters:
d - the double to be converted.
Returns:
a string representation of the argument.
-----
Ecil C. Teodoro
Software Architect
E-Cube Systems
Banking Solutions
S�o Paulo - Brazil
mailto:[EMAIL PROTECTED]
-----
----- Original Message -----
From: "Jos� Vieira" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, August 01, 2002 5:26 PM
Subject: [java-list] parse double para string
> Ol� Pessoal
> este exemplo eu fa�o um parse de string para double
> double n_total2 = Double.parseDouble(v_total);
>
> como faria para fazer de double para string ??
>
>
>
>
>
> Jose Vieira
> S.A.R. Sistemas S/A
> [EMAIL PROTECTED]
> (0xx11) 3361-6355
>
>
>
> ------------------------------ LISTA SOUJAVA ----------------------------
> http://www.soujava.org.br - Sociedade de Usu�rios Java da Sucesu-SP
> d�vidas mais comuns: http://www.soujava.org.br/faq.htm
> regras da lista: http://www.soujava.org.br/regras.htm
> historico: http://www.mail-archive.com/java-list%40soujava.org.br
> para sair da lista: envie email para [EMAIL PROTECTED]
> -------------------------------------------------------------------------
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.380 / Virus Database: 213 - Release Date: 24/07/2002
_______________________________________________________________________
Yahoo! Encontros
O lugar certo para encontrar a sua alma g�mea.
http://br.encontros.yahoo.com/
------------------------------ LISTA SOUJAVA ----------------------------
http://www.soujava.org.br - Sociedade de Usu�rios Java da Sucesu-SP
d�vidas mais comuns: http://www.soujava.org.br/faq.htm
regras da lista: http://www.soujava.org.br/regras.htm
historico: http://www.mail-archive.com/java-list%40soujava.org.br
para sair da lista: envie email para [EMAIL PROTECTED]
-------------------------------------------------------------------------