wc_get_price_decimals()
Return the number of decimals after the decimal point.
Description #Description
Return #Return
(int)
Source #Source
File: includes/wc-formatting-functions.php
function wc_get_price_decimals() { return absint( apply_filters( 'wc_get_price_decimals', get_option( 'woocommerce_price_num_decimals', 2 ) ) ); }
Changelog #Changelog
Version | Description |
---|---|
2.3 | Introduced. |
Related #Related
Used By #Used By
Used By | Description |
---|---|
includes/admin/class-wc-admin-post-types.php: WC_Admin_Post_Types::set_new_price() |
Set the new regular or sale price if requested. |
packages/woocommerce-blocks/src/Assets/AssetDataRegistry.php: AssetDataRegistry::get_currency_data() |
Get currency data to include in settings. |
packages/woocommerce-blocks/src/StoreApi/Formatters/CurrencyFormatter.php: CurrencyFormatter::format() |
Format a given value and return the result. |
packages/woocommerce-blocks/src/StoreApi/Formatters/MoneyFormatter.php: MoneyFormatter::format() |
Format a given value and return the result. |
packages/woocommerce-blocks/src/StoreApi/Utilities/ProductQuery.php: ProductQuery::prepare_price_filter() |
Converts price filter from subunits to decimal. |
packages/woocommerce-blocks/src/StoreApi/Schemas/CartFeeSchema.php: CartFeeSchema::get_item_response() |
Convert a WooCommerce cart fee to an object suitable for the response. |
packages/woocommerce-blocks/src/StoreApi/Schemas/ProductSchema.php: ProductSchema::prepare_product_price_response() |
Get an array of pricing data. |
packages/woocommerce-blocks/src/StoreApi/Schemas/ProductSchema.php: ProductSchema::get_price_range() |
Get price range from certain product types. |
packages/woocommerce-blocks/src/StoreApi/Schemas/CartSchema.php: CartSchema::get_item_response() |
Convert a woo cart into an object suitable for the response. |
packages/woocommerce-blocks/src/StoreApi/Schemas/CartSchema.php: CartSchema::get_tax_lines() |
Get tax lines from the cart and format to match schema. |
packages/woocommerce-blocks/src/StoreApi/Schemas/OrderCouponSchema.php: OrderCouponSchema::get_item_response() |
Convert an order coupon to an object suitable for the response. |
packages/woocommerce-blocks/src/StoreApi/Schemas/CartItemSchema.php: CartItemSchema::get_item_response() |
Convert a WooCommerce cart item to an object suitable for the response. |
packages/woocommerce-blocks/src/StoreApi/Schemas/CartCouponSchema.php: CartCouponSchema::get_item_response() |
Generate a response from passed coupon code. |
packages/woocommerce-blocks/src/StoreApi/Schemas/CartShippingRateSchema.php: CartShippingRateSchema::get_rate_response() |
Response for a single rate. |
packages/woocommerce-blocks/src/StoreApi/Schemas/ProductCollectionDataSchema.php: ProductCollectionDataSchema::get_item_response() |
Format data. |
includes/class-wc-discounts.php: WC_Discounts::get_object_subtotal() |
Get the object subtotal |
includes/wc-formatting-functions.php: wc_price() |
Format the price with a currency symbol. |
includes/wc-formatting-functions.php: wc_format_decimal() |
Format decimal numbers ready for DB storage. |
includes/wc-formatting-functions.php: wc_round_tax_total() |
Round a tax amount. |
includes/admin/class-wc-admin-assets.php: WC_Admin_Assets::admin_scripts() |
Enqueue scripts. |
includes/admin/reports/class-wc-report-sales-by-date.php: WC_Report_Sales_By_Date::round_chart_totals() |
Round our totals correctly. |
includes/admin/reports/class-wc-report-sales-by-category.php: WC_Report_Sales_By_Category::get_main_chart() |
Get the main chart. |
includes/wc-core-functions.php: wc_remove_number_precision() |
Remove precision from a number and return a float. |
includes/wc-core-functions.php: wc_get_rounding_precision() |
Get rounding precision for internal WC calculations. |
includes/wc-core-functions.php: wc_add_number_precision() |
Add precision to a number and return a number. |
includes/gateways/paypal/includes/class-wc-gateway-paypal-ipn-handler.php: WC_Gateway_Paypal_IPN_Handler::payment_status_refunded() |
Handle a refunded order. |
includes/class-wc-structured-data.php: WC_Structured_Data::generate_product_data() |
Generates Product structured data. |
includes/class-wc-order.php: WC_Order::get_remaining_refund_amount() |
How much money is left to refund? |
includes/legacy/api/class-wc-rest-legacy-orders-controller.php: WC_REST_Legacy_Orders_Controller::prepare_item_for_response() |
Prepare a single order output for response. |
includes/legacy/api/v2/class-wc-api-server.php: WC_API_Server::get_index() |
Get the site index. |
includes/legacy/api/v2/class-wc-api-products.php: WC_API_Products::get_product_data() |
Get standard product data that applies to every product type |
includes/legacy/api/v2/class-wc-api-products.php: WC_API_Products::get_variation_data() |
Get an individual variation’s data |
includes/legacy/class-wc-legacy-cart.php: WC_Legacy_Cart::__get() |
Magic getters. |
includes/legacy/abstract-wc-legacy-order.php: WC_Abstract_Legacy_Order::legacy_set_total() |
Set an order total. |
includes/class-wc-cart.php: WC_Cart::get_taxes_total() |
Get tax row amounts with or without compound taxes includes. |
includes/class-wc-cart.php: WC_Cart::get_coupon_discount_amount() |
Get the discount amount for a used coupon. |
includes/class-wc-cart.php: WC_Cart::get_coupon_discount_tax_amount() |
Get the discount tax amount for a used coupon (for tax inclusive prices). |
includes/class-wc-cart.php: WC_Cart::get_tax_totals() |
Get taxes, merged by code, formatted ready for output. |
includes/class-wc-cart.php: WC_Cart::set_total() |
Set cart total. |
includes/class-wc-ajax.php: WC_AJAX::variation_bulk_adjust_price() |
Bulk action – Set Price. |
includes/class-wc-ajax.php: WC_AJAX::refund_line_items() |
Handle a refund via the edit order screen. |
includes/data-stores/class-wc-product-variable-data-store-cpt.php: WC_Product_Variable_Data_Store_CPT::read_price_data() |
Get an array of all sale and regular prices from all variations. This is used for example when displaying the price range at variable product level or seeing if the variable product is on sale. |
includes/wc-product-functions.php: wc_update_product_lookup_tables_column() |
Populate lookup table column data. |
includes/wc-product-functions.php: wc_get_price_including_tax() |
For a given product, and optionally price/qty, work out the price with tax included, based on store settings. |
includes/abstracts/abstract-wc-order.php: WC_Abstract_Order::get_line_subtotal() |
Get line subtotal – this is the cost before discount. |
includes/abstracts/abstract-wc-order.php: WC_Abstract_Order::get_item_total() |
Calculate item cost – useful for gateways. |
includes/abstracts/abstract-wc-order.php: WC_Abstract_Order::get_line_total() |
Calculate line total – useful for gateways. |
includes/abstracts/abstract-wc-order.php: WC_Abstract_Order::calculate_totals() |
Calculate totals by looking at the contents of the order. Stores the totals and returns the orders final total. |
includes/abstracts/abstract-wc-order.php: WC_Abstract_Order::get_item_subtotal() |
Get item subtotal – this is the cost before discount. |
includes/abstracts/abstract-wc-order.php: WC_Abstract_Order::set_total_tax() |
Sets order tax (sum of cart and shipping tax). Used internally only. |
includes/abstracts/abstract-wc-order.php: WC_Abstract_Order::set_total() |
Set total. |
includes/abstracts/abstract-wc-order.php: WC_Abstract_Order::get_subtotal() |
Gets order subtotal. |
includes/abstracts/abstract-wc-shipping-method.php: WC_Shipping_Method::add_rate() |
Add a shipping rate. If taxes are not set they will be calculated based on cost. |
includes/wc-deprecated-functions.php: wc_get_min_max_price_meta_query() |
Get min/max price meta query args. |
includes/wc-deprecated-functions.php: woocommerce_format_total() |
Formal total costs – format to the number of decimal places for the base currency. |
includes/shipping/free-shipping/class-wc-shipping-free-shipping.php: WC_Shipping_Free_Shipping::is_available() |
See if free shipping is available based on the package and cart. |
includes/shipping/legacy-free-shipping/class-wc-shipping-legacy-free-shipping.php: WC_Shipping_Legacy_Free_Shipping::is_available() |
Check if package is available. |
includes/class-wc-cart-totals.php: WC_Cart_Totals::calculate_totals() |
Main cart totals. |
packages/woocommerce-admin/src/API/Reports/Products/DataStore.php: DataStore::sync_order_products() |
Create or update an entry in the wc_admin_order_product_lookup table for an order. |
packages/woocommerce-admin/src/Loader.php: Loader::get_currency_settings() |
Return an object defining the currecy options for the site’s current currency |
includes/rest-api/Controllers/Version1/class-wc-rest-orders-v1-controller.php: WC_REST_Orders_V1_Controller::get_collection_params() |
Get the query params for collections. |
includes/rest-api/Controllers/Version1/class-wc-rest-orders-v1-controller.php: WC_REST_Orders_V1_Controller::prepare_item_for_response() |
Prepare a single order output for response. |
includes/rest-api/Controllers/Version1/class-wc-rest-order-refunds-v1-controller.php: WC_REST_Order_Refunds_V1_Controller::prepare_item_for_response() |
Prepare a single order refund output for response. |
includes/rest-api/Controllers/Version1/class-wc-rest-order-refunds-v1-controller.php: WC_REST_Order_Refunds_V1_Controller::get_collection_params() |
Get the query params for collections. |
includes/rest-api/Controllers/Version2/class-wc-rest-system-status-v2-controller.php: WC_REST_System_Status_V2_Controller::get_settings() |
Get some setting values for the site that are useful for debugging purposes. For full settings access, use the settings api. |
includes/rest-api/Controllers/Version2/class-wc-rest-order-refunds-v2-controller.php: WC_REST_Order_Refunds_V2_Controller::prepare_object_for_response() |
Prepare a single order output for response. |
includes/rest-api/Controllers/Version2/class-wc-rest-orders-v2-controller.php: WC_REST_Orders_V2_Controller::get_collection_params() |
Get the query params for collections. |
includes/rest-api/Controllers/Version2/class-wc-rest-orders-v2-controller.php: WC_REST_Orders_V2_Controller::prepare_object_for_response() |
Prepare a single order output for response. |