FORMAT DES NOMBRES

cs_hanadi Messages postés 1 Date d'inscription mardi 28 janvier 2003 Statut Membre Dernière intervention 21 juin 2003 - 21 juin 2003 à 12:15
cs_rahma25 Messages postés 4 Date d'inscription lundi 27 novembre 2006 Statut Membre Dernière intervention 30 novembre 2008 - 30 nov. 2008 à 22:24
Merci de me trouver une réponse c'est urgent :

Voilà j'ai un textbox qui reprends la valeur d'un nombre double

ttl As Double

Label5.Caption = ttl

Mon probleme c'est que je veux avoir un format avec 3 chiffres apres la virgule quoi qu'il on soit :

1.96 --> 1.960

4 réponses

cs_Crazyht Messages postés 1522 Date d'inscription mardi 18 décembre 2001 Statut Membre Dernière intervention 21 août 2010 8
21 juin 2003 à 13:41
Label5.Caption = format (ttl, "#####,000")

et voila :)

A++

:-p Crazyht :)

[Admin Codes-Sources]
[Membre Developer-Association]
0
cs_rahma25 Messages postés 4 Date d'inscription lundi 27 novembre 2006 Statut Membre Dernière intervention 30 novembre 2008
12 janv. 2008 à 13:31
essayez d'utiliser la forme suivante:
si vous voulez afficher un resultat  (result) dans une textbox (text1) :

text1.text=format(variable, "#.000"
0
cs_rahma25 Messages postés 4 Date d'inscription lundi 27 novembre 2006 Statut Membre Dernière intervention 30 novembre 2008
12 janv. 2008 à 13:34
pardons,
text1.text=format(result, "#.000")
0
cs_rahma25 Messages postés 4 Date d'inscription lundi 27 novembre 2006 Statut Membre Dernière intervention 30 novembre 2008
30 nov. 2008 à 22:24
exemple:

Private Sub Text1_Change()
ttl = Text1
Label1.Caption = Format(ttl, "#.000")
End Sub

si votre séparateur décimal est  " , "     (<style><![CDATA[o-pagination:widow-orphan;
direction:rtl;
unicode-bidi:embed;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
@page Section1
{size:595.3pt 841.9pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;
mso-header-margin:35.4pt;
mso-footer-margin:35.4pt;
mso-paper-source:0;
mso-gutter-direction:rtl;}
div.Section1
{page:Section1;}
-->
]]></style><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Tableau Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";
mso-ansi-language:#0400;
mso-fareast-language:#0400;
mso-bidi-language:#0400;}
</style>
<![endif]--><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026"/>
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1"/>
</o:shapelayout></xml><![endif]-->

virgule) 

alors
Label1.Caption = Format(ttl, "#,000")
si le séparateur est "."   (point)  alors
Label1.Caption = Format(ttl, "#.000")
0
Rejoignez-nous