E.g.That's untested but I believe it should do the job. You can test and adjust if required.vbn.et Code:
Private Function GetFormatSpecifier(increment As Double) As String Dim formatSpecifier As String Dim text = increment.ToString() If text.Contains(".") Then Dim fraction = text.Substring(text.IndexOf(".") + 1) formatSpecifier = "n" & fraction.Length Else formatSpecifier = "n0" End If Return formatSpecifier End Function




Reply With Quote
