Home > Common Problem > body text

VB Format function usage

angryTom
Release: 2020-03-05 14:18:20
Original
9971 people have browsed it

VB Format function usage

VB Format函数用法

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

推荐:《编程视频教程

语法

Format(expression[, format[, firstdayofweek[, firstweekofyear]]])
Copy after login

参数说明

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

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

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

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

使用示例

hour = Format((time \ 60), "00000")
Copy after login

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

其他示例:

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

更多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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template