FTIW I use these similar routines to display Integers and decimals:
[code]Function getLargeIntegerWAD(largeNumber As Int64, decimalPoints As Integer = 0, formatString As String = “####################0”) As String
Dim returnResult As String
if decimalPoints > 0 and instr(formatString, “.”) = 0 then 'don’t add two periods!
formatString = formatString + “.”
for tempInt As Integer = 0 to decimalPoints
formatString = formatString + “0”
next
end if
returnResult = Format(largeNumber, formatString)
if instr(formatString, “.”) > 0 then 'don’t remove the final zero if it’s not a decimal!
while right(returnResult, 1) = “0”
returnResult = left(returnResult, len(returnResult) - 1) 'remove trailing zeros
wend
end if
if right(returnResult, 1) = “.” then returnResult = left(returnResult, len(returnResult) - 1) 'remove trailing period
Return returnResult
End Function
[/code]
[code]Function getLargeDecimalWAD(largeNumber As Double, decimalPoints As Integer = 0, formatString As String = “###,###,###,###,###,###,##0”) As String
Dim returnResult As String
if decimalPoints > 0 and instr(formatString, “.”) = 0 then 'don’t add two periods!
formatString = formatString + “.”
for tempInt As Integer = 0 to decimalPoints
formatString = formatString + “0”
next
end if
returnResult = Format(largeNumber, formatString)
if instr(formatString, “.”) > 0 then 'don’t remove the final zero if it’s not a decimal!
while right(returnResult, 1) = “0”
returnResult = left(returnResult, len(returnResult) - 1) 'remove trailing zeros
wend
end if
if right(returnResult, 1) = “.” then returnResult = left(returnResult, len(returnResult) - 1) 'remove trailing period
Return returnResult
End Function
[/code]