hook_entity_presave showing error in commerce kickstart
Try the code without using the following line.

$total_amount = commerce_currency_format($amount, $currency_code);


The remaining code will be the following,

function custom_module_entity_presave($product, $type) {
  if ($type == 'commerce_product') {
    $cal=commerce_product_calculate_sell_price($product);
    $currency_code=$cal['currency_code'];
    $amount=$cal['amount'];
    $product-&gt;field_calculated_price['und'][0]['value']=$amount;
  }
}


If this code not showing error, then the problem will be on your field_calculated_price field type. I think it is a custom field and the problem is the field type is not compatible with commerce_currency_format.

Please make try... Hope this will help you.