Probleme mathématiqe

Probleme mathématiqe - Java - Programmation

Marsh Posté le 07-05-2003 à 12:04:29    

Voila j'effectue les operations suivantes pour arrondir un nombre à 10^-5 :
 
double a=0.000427;
a *= 100000;
a = (int)(a+.5);
a /= 100000;
 
Lorsque je decide d'afficher le resultat apparait alors : 4.30E-04
 
Or j voudrait que s'affiche 0.00043
 
Merci beaucoup.

Reply

Marsh Posté le 07-05-2003 à 12:04:29   

Reply

Marsh Posté le 07-05-2003 à 12:06:00    

java.text.NumberFormat et ses dérivés.


---------------
Everyone thinks of changing the world, but no one thinks of changing himself  |  It is the peculiar quality of a fool to perceive the faults of others and to forget his own  |  Early clumsiness is not a verdict, it’s an essential ingredient.
Reply

Marsh Posté le 07-05-2003 à 12:07:58    

Taiche a écrit :

java.text.NumberFormat et ses dérivés.


 
quel talent! [:prosterne]


---------------
Just because you feel good does not make you right
Reply

Marsh Posté le 07-05-2003 à 12:10:40    

DarkLord a écrit :


quel talent! [:prosterne]


Ta gueule :o
[:ban]


---------------
Everyone thinks of changing the world, but no one thinks of changing himself  |  It is the peculiar quality of a fool to perceive the faults of others and to forget his own  |  Early clumsiness is not a verdict, it’s an essential ingredient.
Reply

Marsh Posté le 07-05-2003 à 12:12:29    


 
je m'auto prosterne [:prosterne]


---------------
Just because you feel good does not make you right
Reply

Marsh Posté le 07-05-2003 à 12:13:40    

DarkLord a écrit :


je m'auto prosterne [:prosterne]


Arrête ou j'me remets à écrire [:prosterne]Maître[:prosterne2] partout :o


---------------
Everyone thinks of changing the world, but no one thinks of changing himself  |  It is the peculiar quality of a fool to perceive the faults of others and to forget his own  |  Early clumsiness is not a verdict, it’s an essential ingredient.
Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed