bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths

Loading lesson path

Learn/SQL/SQL References
SQL•SQL References

MySQL FORMAT() Function

Example

SELECT FORMAT(250500.5634, 2);

Definition and Usage

The FORMAT() function formats a number to a format like "#,###,###.##", rounded to a specified number of decimal places, then it returns the result as a string.

Syntax

FORMAT(
number
,
decimal_places
)

Parameter Values

ParameterDescription
numberRequired. The number to be formatted
decimal_placesRequired. The number of decimal places for number. If this parameter is 0, this function returns a string with no decimal places

Technical Details

Works in:From MySQL 4.0

Previous

MySQL FIND_IN_SET() Function

Next

MySQL INSERT() Function