Function wc_format_decimal
Format decimal numbers ready for DB storage
Sanitize, remove locale formatting, and optionally round + trim off zeros
Parameters summary
float|string |
$number |
Expects either a float or a string with a decimal separator only (no thousands) |
mixed |
$dp = false |
number of decimal points to use, blank to use woocommerce_price_num_decimals, or false to avoid all rounding. |
boolean |
$trim_zeros = false |
from end of string |
Return value summary
string
|