Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
3144 connectés 

  FORUM HardWare.fr
  Programmation
  Java

  Android - SetText avec un double

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

Android - SetText avec un double

n°2021836
Loordes
Posté le 08-09-2010 à 13:50:00  profilanswer
 

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 :)

mood
Publicité
Posté le 08-09-2010 à 13:50:00  profilanswer
 

n°2021837
masklinn
í dag viðrar vel til loftárása
Posté le 08-09-2010 à 13:52:00  profilanswer
 

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 by throwing away the limits imposed by overbearing genetic regulations? Isn't that a good thing?
n°2021840
Loordes
Posté le 08-09-2010 à 13:58:23  profilanswer
 

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 ;)

n°2021841
masklinn
í dag viðrar vel til loftárása
Posté le 08-09-2010 à 14:00:33  profilanswer
 

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 by throwing away the limits imposed by overbearing genetic regulations? Isn't that a good thing?
n°2021844
Loordes
Posté le 08-09-2010 à 14:06:55  profilanswer
 

masklinn a écrit :


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


 
Okey, merci du conseil  :jap:


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  Java

  Android - SetText avec un double

 

Sujets relatifs
Compatibilité avec AndroïdMySQL : vérification de syntaxe de double jointure
Probleme pour convertir une chaine en variable doubledouble fleche de redimensionnement des fenetres
problème convertion d'une chaine en doubleDouble cote
problème de calcul d'une moyenne en 'double'Comment interdire le double clic sur un bouton dans une anim flash ?
[C] Probleme swap liste double chainéePages en double/triple et référencement
Plus de sujets relatifs à : Android - SetText avec un double


Copyright © 1997-2025 Groupe LDLC (Signaler un contenu illicite / Données personnelles)