双精度型显示出来是.5,我想显示0.5怎么做到呀高手帮帮我

解决方案 »

  1.   

    可以的
    你用的是 Double 型存 的变量吧?
    然后用
    你想在那里显示这个变量 = Format(变量名, "0.0")
    这样就可以把 Double  的值给显示成0.0的形式了
      

  2.   

    Private Sub Command1_Click()
        Dim d As Double
        d = 0.5
        MsgBox d
        
        MsgBox Format(d, "standard")
    End Sub
      

  3.   

    Private Sub Command1_Click()
        Dim d As Variant
        d = 0.5
        d = Format(d, "0.0")
        MsgBox d
    End Sub
      

  4.   

    private sub text1_changed()
    if left(text1.text,1)="." then text1.text ="0" &  text1.text  
    end sub
      

  5.   

    简单点:只要将WINDOWS控制面板里的区域设置-数字项里的‘零起始显示’
             .7改为0.7