I have added a custom field that is getting and displaying the value on the front-end. The issue arises when the field is empty or the value is 0, it shows empty on the front end. I want to display '0.00' instead of empty. Is there any switch statement that can go in the code? or what
function corecharge_woocommerce_display_product_attributes($product_attributes, $mproduct){
$product_attributes['corecharge-field'] = [
'label' => __('Core Charge', 'text-domain'),
'value' => get_post_meta($mproduct->get_ID(), '_number_field', true),
];
// echo var_dump($product_attributes);
return $product_attributes;
}