99
格式化为2位小数     99.0
格式化为2位小数     99.00
格式化为3位小数     99.000
格式化为4位小数     99.0000
格式化为5位小数     99.00000
代码如何实现?

解决方案 »

  1.   

    format(99,"0.0")
    format(99,"0.00")
    .....
      

  2.   

    你的“所有数字”是指?放在数组中还是字符串中还是变量 or数据库etc???
      

  3.   

    for i=1 to 5:?format(99,left("0.00000",2+i)):next
      

  4.   

    '参数data-->数据,decNum-->小数位数
    Function FormatData(ByVal data As Double, ByVal decNum As Integer) As String
        Dim s As String
        s = Format(data, "0." & String(decNum, "0"))
        FormatData = s
    End Function要一次性,自己循环来调用这个函数