How can PHP functions like number_format() be utilized to standardize numerical formats in a database?

When storing numerical data in a database, it is important to maintain a consistent format for ease of manipulation and readability. PHP functions like number_format() can be utilized to standardize numerical formats by formatting numbers with a specific number of decimal places, thousands separator, and decimal point.

// Example of using number_format() to standardize numerical formats in a database
$number = 1234567.89;
$formatted_number = number_format($number, 2, '.', ','); // Format number with 2 decimal places, comma as thousands separator, and dot as decimal point

// Insert $formatted_number into the database
$query = "INSERT INTO table_name (number_column) VALUES ('$formatted_number')";
mysqli_query($connection, $query);