Android - SetText avec un double

Android - SetText avec un double - Java - Programmation

Marsh Posté le 08-09-2010 à 13:50:00    

Salut,
 
Je développe une petite application Android.
 
j'ai besoin d'afficher un montant (un double) dans un TextView pour l'utilisateur. or, le TextView par la méthode "setText()" n'accepte que des String.
 
Comment faire pour afficher mon montant ?
 
Merci :)

Reply

Marsh Posté le 08-09-2010 à 13:50:00   

Reply

Marsh Posté le 08-09-2010 à 13:52:00    

Tu formattes ton double en string [:pingouino dei]


---------------
I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box, and replicate and expand beyond their wildest dreams by throwing away the limits imposed by overbearing genetic r
Reply

Marsh Posté le 08-09-2010 à 13:58:23    

masklinn a écrit :

Tu formattes ton double en string [:pingouino dei]


 
Lol, en lisant ta phrase j'ai pensé au Double.toString()  
 
En effet, j'avais testé que le cast classique comme un âne.  
 
Je dois pas être bien reveillé.
Merci ;)

Reply

Marsh Posté le 08-09-2010 à 14:00:33    

Loordes a écrit :

Lol, en lisant ta phrase j'ai pensé au Double.toString()  
 
En effet, j'avais testé que le cast classique comme un âne.


Double.toString() c'est super limitant/limité, mieux vaut utiliser String.format :o


---------------
I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box, and replicate and expand beyond their wildest dreams by throwing away the limits imposed by overbearing genetic r
Reply

Marsh Posté le 08-09-2010 à 14:06:55    

masklinn a écrit :


Double.toString() c'est super limitant/limité, mieux vaut utiliser String.format :o


 
Okey, merci du conseil  :jap:

Reply

Sujets relatifs:

Leave a Replay

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