Lưu ý
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử đăng nhập hoặc thay đổi thư mục.
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử thay đổi thư mục.
Applies to:
Databricks SQL
Databricks Runtime
Formats expr like #,###,###.##, rounded to scale decimal places.
Formats expr like fmt.
Syntax
format_number(expr, scale)
format_number(expr, fmt)
Arguments
expr: An expression that evaluates to a numeric.scale: AnINTEGERexpression greater than or equal to 0.fmt: ASTRINGexpression specifying a format.
Returns
A STRING.
A negative scale produces a null.
Examples
> SELECT format_number(12332.123456, 4);
12,332.1235
> SELECT format_number(12332.123456, '#.###');
12332.123
> SELECT format_number(12332.123456, 'EUR ,###.-');
EUR 12,332.-