mounakarim
Messages postés11Date d'inscriptionsamedi 2 décembre 2006StatutMembreDernière intervention24 juin 2008
-
26 mai 2008 à 20:32
mounakarim
Messages postés11Date d'inscriptionsamedi 2 décembre 2006StatutMembreDernière intervention24 juin 2008
-
27 mai 2008 à 04:12
Comment convertir des chiffres en lettres(en vb.net)?
par exemple 21,75 doit apparaitre sous la forme vingt et un dirham et soixante quinze centimes.
D'avaance merciiiiiii troooooooooooop.
karimos
cs_Dominike
Messages postés70Date d'inscriptionjeudi 13 février 2003StatutMembreDernière intervention 6 mars 2010 26 mai 2008 à 21:02
Je dirai si tes 21,75 sont en cellule A1.
Inscrit en cellule B1 =ARRONDI.INF(F19;0) tu obtiens 21
Inscrit en cellule B2 =DROITE(A1;2) tu obtiens 75
Inscrit en cellule B3 = concatener (B1; "dihram(s)"; B2; " centimes")
Peut-être y a t-il plus simple !... mais ça fonctionne.
-Dominike -
cs_Dominike
Messages postés70Date d'inscriptionjeudi 13 février 2003StatutMembreDernière intervention 6 mars 2010 26 mai 2008 à 21:03
Je dirai si tes 21,75 sont en cellule A1.
Inscrit en cellule B1 =ARRONDI.INF(A1;0) tu obtiens 21
Inscrit en cellule B2 =DROITE(A1;2) tu obtiens 75
Inscrit en cellule B3 = concatener (B1; "dihram(s)"; B2; " centimes")
Peut-être y a t-il plus simple !... mais ça fonctionne.
Pardon j'ai corrigé en rouge.
If Int(
CDbl(VB.Right(inp, 1))) > 0
And
CDbl(VB.Left(inp, 1)) > 1
Then RetVal = GetFigures(
CStr(Int(
CDbl(VB.Right(inp, 1)))))
' from 20 to 90 step 10
If
CDbl(VB.Left(inp, 1)) > 1
Then RetVal = Three(
CInt(VB.Left(inp, 1))) & RetVal
' from 20-99
If
CDbl(VB.Left(inp, 1)) = 1
Then RetVal = two(
CInt(VB.Right(inp, 1)))
' from 11-19 range
Case 3
If Int(
CDbl(VB.Right(inp, 2))) > 0
Then RetVal = GetFigures(
CStr(Int(
CDbl(VB.Right(inp, 2)))))RetVal = GetFigures(Int(
CDbl(VB.Left(inp, 1)))) & Hundred & RetVal
Case 4
If Int(
CDbl(VB.Right(inp, 3))) > 0
Then RetVal = GetFigures(
CStr(Int(
CDbl(VB.Right(inp, 3)))))RetVal = GetFigures(Int(
CDbl(VB.Left(inp, 1)))) & Thousand & RetVal
Case 5
If Int(
CDbl(VB.Right(inp, 3))) > 0
Then RetVal = GetFigures(
CStr(Int(
CDbl(VB.Right(inp, 3)))))RetVal = GetFigures(Int(
CDbl(VB.Left(inp, 2)))) & Thousand & RetVal
Case 6
If
CInt(VB.Right(inp, 5)) > 0
Then RetVal = GetFigures(
CStr(
CInt(VB.Right(inp, 5))))RetVal = GetFigures(Int(
CDbl(VB.Left(inp, 1)))) & lakh & RetVal
Case 7
If
CInt(VB.Right(inp, 5)) > 0
Then RetVal = GetFigures(
CStr(
CInt(VB.Right(inp, 5))))RetVal = GetFigures(Int(
CDbl(VB.Left(inp, 2)))) & lakh & RetVal
Case 8
If
CInt(VB.Right(inp, 7)) > 0
Then RetVal = GetFigures(
CStr(
CInt(VB.Right(inp, 7))))RetVal = GetFigures(Int(
CDbl(VB.Left(inp, 1)))) & Crore & RetVal
Case 9
If
CInt(VB.Right(inp, 7)) > 0
Then RetVal = GetFigures(
CStr(
CInt(VB.Right(inp, 7))))RetVal = GetFigures(Int(
CDbl(VB.Left(inp, 2)))) & Crore & RetVal
Case 10
If
CInt(VB.Right(inp, 9)) > 0
Then RetVal = GetFigures(
CStr(
CInt(VB.Right(inp, 9))))RetVal = GetFigures(Int(
CDbl(VB.Left(inp, 1)))) & Billion & RetVal
Case 11
If
CInt(VB.Right(inp, 9)) > 0
Then RetVal = GetFigures(
CStr(
CInt(VB.Right(inp, 9))))RetVal = GetFigures(Int(
CDbl(VB.Left(inp, 2)))) & Billion & RetVal
Case 12
If Val(VB.Right(inp, 11)) > 0 Then RetVal GetFigures(VB.Right(inp, 11))RetVal GetFigures(Int(
CDbl(VB.Left(inp, 1)))) & Million & RetVal
Case 13
If Val(VB.Right(inp, 11)) > 0 Then RetVal GetFigures(VB.Right(inp, 11))RetVal GetFigures(Int(
CDbl(VB.Left(inp, 2)))) & Million & RetVal
Case 14
If Val(VB.Right(inp, 13)) > 0 Then RetVal GetFigures(VB.Right(inp, 13))RetVal GetFigures(Int(
CDbl(VB.Left(inp, 1)))) & Trillion & RetVal
Case 15
If Val(VB.Right(inp, 13)) > 0 Then RetVal GetFigures(VB.Right(inp, 13))RetVal GetFigures(Int(
End
Function
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''__________________________________________''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Une zone de text dans elle en saisie les chifres
Private
Sub txtNumber_KeyPress(ByVal eventSender As System.Object, ByVal eventArgs As System.Windows.Forms.KeyPressEventArgs) Handles txtNumber.KeyPress
Dim KeyAscii
AsShort Asc(eventArgs.KeyChar)KeyAscii IIf(IsNumeric(Chr(KeyAscii))
Or (InStr(txtNumber.Text,
".") = 0
And KeyAscii = 46)
Or KeyAscii = 8, KeyAscii, 0)
Private
Sub btnCalculate_Click(
ByVal eventSender
As System.Object,
ByVal eventArgs
As System.EventArgs)
Handles btnCalculate.ClicklblString.Text = GetFigures((txtNumber.Text))
End
Sub
Merciiiii bon couragggggggggggggggges
Vous n’avez pas trouvé la réponse que vous recherchez ?