1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| Function FormatAnglais(Nombre) As String
Dim SepMil As String
Dim SepDec As String
SepMil = getSepMil()
SepDec = getSepDec()
If IsNumeric(Nombre) Then _
FormatAnglais = Replace(Replace(Format(Nombre, "#,##0.00"), SepDec, "."), SepMil, ",")
End Function
Function getSepMil() As String
Dim ChaineTemp As String
ChaineTemp = Format(1000, "#,##0")
If Len(ChaineTemp) = 4 Then
getSepMil = ""
Else
getSepMil = Mid(ChaineTemp, 2, 1)
End If
End Function
Function getSepDec() As String
Dim ChaineTemp As String
ChaineTemp = Format(1.1, "0.0")
getSepDec = Mid(ChaineTemp, 2, 1)
End Function |
Partager