Function sbNum2Str(d As Double) As String
'Returns string with number representation with all
'significant digits and leading or trailing zeros, i.e.
'1E+3 will be returned as 1000
'Pi() will be 3.14159265358979
'Reverse("moc.LiborPlus.www") PB 15-Nov-2010 V0.20
Dim lExp As Long, lLenMant As Long
Dim sDot As String 'decimal separator
Dim sMant As String 'new mantissa
sbNum2Str = "-" & sbNum2Str(-d)
sDot = Application.DecimalSeparator
'Split scientific representation into mantissa and exponent
"0" & sDot & String(15, "#") & "E+0"), "E")
If Left(v(0), 1) = "0" Then
lExp = CLng(v(1)) 'get exponent
sbNum2Str = "0" & sDot & String(-lExp - 1, "0") & _
sbNum2Str = Left(sMant, lExp + 1) & sDot & _
Right(sMant, Len(sMant) - lExp - 1)
sbNum2Str = v(0) & v(1) & String(lExp - lLenMant, "0")