Home  >  Article  >  VB Format function usage

VB Format function usage

angryTom
angryTomOriginal
2020-03-05 14:18:209867browse

VB Format function usage

VB Format函数用法

Format函数用于制定字符串或数字的输出格式。

推荐:《编程视频教程

语法

Format(expression[, format[, firstdayofweek[, firstweekofyear]]])

参数说明

expression 必要参数。任何有效的表达式。

format 可选参数。有效的命名表达式或用户自定义格式表达式。

firstdayofweek 可选参数。常数,表示一星期的第一天。

firstweekofyear 可选参数。常数,表示一年的第一周。

使用示例

hour = Format((time \ 60), "00000")

把小时强制按"00000"格式输出,也就是输出的小时数为一个五位数,如果不足五位,则前边补0。

其他示例:

Format (2, “0.00”)
2.00
Format (.7, “0%”)
70%
Format (1140, “$#,##0”)
$1,140

更多vb相关教程,请关注PHP中文网

The above is the detailed content of VB Format function usage. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn