VBA/Excel/Access/Word/Data Type/Double — различия между версиями

Материал из VB Эксперт
Перейти к: навигация, поиск
м (1 версия)
 
(нет различий)

Версия 16:33, 26 мая 2010

Double and Single

 
Sub doubleDemo()
    Dim sngNumber As Single
    Dim dblNumber As Double
    sngNumber = 123.456
    dblNumber = 789.012
End Sub



Double value

 
Sub AtnDemo()
    Dim pi As Double
    pi = 4 * Atn(1)
End Sub



Mathematica does not understand 1.2E-03, use -03 instead

 
Function Scientific(s As String) As String
  Dim pos%
  pos = InStr(s, "E")
  If pos Then
    Scientific = Left(s, pos - 1) + "*10^" + Mid(s, pos + 1)
  Else
    Scientific = s
  End If
End Function