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

  FORUM HardWare.fr
  Programmation
  VB/VBA/VBS

  [VB] Les reels

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

[VB] Les reels

n°734281
conektion
Posté le 21-05-2004 à 22:02:46  profilanswer
 

Je voudrai tout simplement mettre un reel dans une variable de type single mais je n'y arrive pas! que dois je faire?
 
Dim i As Single
i = 1.2
 
Chez moi ca affiche "1"...

mood
Publicité
Posté le 21-05-2004 à 22:02:46  profilanswer
 

n°734283
drasche
Posté le 21-05-2004 à 22:03:35  profilanswer
 

tu l'affiches comment ton single?


---------------
Whichever format the fan may want to listen is fine with us – vinyl, wax cylinders, shellac, 8-track, iPod, cloud storage, cranial implants – just as long as it’s loud and rockin' (Billy Gibbons, ZZ Top)
n°734285
conektion
Posté le 21-05-2004 à 22:05:02  profilanswer
 

en fait j'affiche le resultat dans un label et ca m'affiche 1 au lieu de 1.2 mais i est bien egal a 1.2


Message édité par conektion le 21-05-2004 à 22:05:23
n°734287
drasche
Posté le 21-05-2004 à 22:08:44  profilanswer
 

j'ai créé une form avec un label et j'ai mis le code suivant, et ça m'affiche 1,2 comme je m'y attendais:
 

Code :
  1. Option Explicit
  2. Private Sub Form_Load()
  3.     Dim i As Single
  4.     i = 1.2
  5.     Label1.Caption = i
  6. End Sub


 
[:spamafote]


---------------
Whichever format the fan may want to listen is fine with us – vinyl, wax cylinders, shellac, 8-track, iPod, cloud storage, cranial implants – just as long as it’s loud and rockin' (Billy Gibbons, ZZ Top)
n°734288
drasche
Posté le 21-05-2004 à 22:09:45  profilanswer
 

regarde un peu les propriétés de ton label (surtout si tu es sous Access), il se peut que le formattage par défaut soit pour afficher de l'entier. Essaie avec 1.7 pour voir si ça t'affiche 2.


---------------
Whichever format the fan may want to listen is fine with us – vinyl, wax cylinders, shellac, 8-track, iPod, cloud storage, cranial implants – just as long as it’s loud and rockin' (Billy Gibbons, ZZ Top)
n°734291
conektion
Posté le 21-05-2004 à 22:15:51  profilanswer
 

haaa je c pas mais mon pc il devien ouf!! taleur ca marchait pas et maintenant ca affiche bien 1.2 alor ke jai pas changer le code. merci pour ton aide  :pt1cable:


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  VB/VBA/VBS

  [VB] Les reels

 

Sujets relatifs
[python] problème avec les nombres réelsACCESS et exportation de nombre réels
[java] problème avec la précision des nombres réelsComment Mettre L'heure Réels et une musique de fond sur sa page persos
Plus de sujets relatifs à : [VB] Les reels


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