vba: what is 97.45 * 1# =?

后端 未结 5 1128
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-17 03:36
some_integer = 97.45 * 1#

what does this notation mean? what will some_integer = ?

5条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-17 03:51

    1# means that 1 is evaluated as a double.

    I doubt that would make any difference to that calculation though. The calculation would still give 97.45 if 1 was undecorated and thus treated as an integer. And when the result of the calculation is assigned to the the integer some_integer it will be 97.

    Sub Macro1()
        Dim i As Integer
        i = 97.45 * 1#
        MsgBox (i) 'Shows 97
    End Sub
    

提交回复
热议问题