' 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 >>I have a numeric field which is holding a value such as 12.45. This value is passed into a GetTransform() function which is as follow:
> ' 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 lnValue As Integer > Dim lnDecimal As Integer > Dim lcValue As String > Dim lcFormat As String > Dim lnCompteur As Integer > lnDecimal = 0 > If tnDecimal > 0 Then > lnDecimal = tnDecimal > End If > > ' Obtain formatted value > lcValue = "TRIM(Format(tnValue,""" > lcFormat = "" > For lnCompteur = 1 To 10 > lcFormat = "#" + lcFormat > If lnCompteur Mod 3 = 0 Then > lcFormat = cSeparator + lcFormat > End If > Next > lcValue = lcValue + lcFormat > > ' If we have decimals > If lnDecimal > 0 Then > lcValue = lcValue + "." + "".PadRight(lnDecimal, "0") > End If > > lcValue = lcValue + """))" >RETURN &lcValue > End Function >>