>> ' Obtain formatted value >> lcFormat = "" >> For lnCompteur = 1 To 10 >> lcFormat = "#" + lcFormat >> If lnCompteur Mod 3 = 0 Then >> lcFormat = cSeparator + lcFormat >> End If >> Next >> >> lcValue = tnValue.ToString(lcFormat) >> >> ' If we have decimals >> If lnDecimal > 0 Then >> lcValue = lcValue + "." >> lcValue = lcValue.PadRight(lnDecimal, "0") >> End If >> >>RETURN lcValue >>>>
> ' Return a transformed value for formatting > ' expN1 Value > ' expC1 Number of decimal > Private Function GetTransform(ByVal tnValue As Integer, Optional ByVal tnDecimal As Integer = 0) As String > Dim lnDecimal As Integer > Dim lcFormat As String > Dim lnCompteur As Integer > lnDecimal = 0 > If tnDecimal > 0 Then > lnDecimal = tnDecimal > End If > > ' Obtain formatted value > lcFormat = "" > For lnCompteur = 1 To 10 > lcFormat = "#" + lcFormat > If lnCompteur Mod 3 = 0 Then > lcFormat = cSeparator + lcFormat > End If > Next > > ' If we have decimals > If lnDecimal > 0 Then > lcFormat = lcFormat + "." + "".PadRight(lnDecimal, "0") > End If > > Return tnValue.ToString(lcFormat) > End Function >