VBGood网站全文搜索 Google

搜索VBGood全站网页(全文搜索)
首页 - 经验之谈 - 格式化数字
发表评论(0)作者:不详, 平台:VB6.0+Win98, 阅读:12470, 日期:2001-05-09
Formatting Numbers
Use Format$(value, "0.00") to get 2 decimal places. Combine this with the "@@@@@" formats to get right justified numbers. For example:
    Print Format$(Format$(123.45, "0.00"), "@@@@@@@@")
    Print Format$(Format$(3.4, "0.00"), "@@@@@@@@")
    Print Format$(Format$(12345.6, "0.00"), "@@@@@@@@")
produces the following list:
      123.45
        3.40
    12345.60