Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /hsphere/local/home/c327781/sibertec.com/index.php:1) in drupal_send_headers() (line 1485 of /hsphere/local/home/c327781/sibertec.com/includes/bootstrap.inc).
  • Warning: Cannot modify header information - headers already sent by (output started at /hsphere/local/home/c327781/sibertec.com/index.php:1) in drupal_send_headers() (line 1485 of /hsphere/local/home/c327781/sibertec.com/includes/bootstrap.inc).
  • Warning: Cannot modify header information - headers already sent by (output started at /hsphere/local/home/c327781/sibertec.com/index.php:1) in drupal_send_headers() (line 1485 of /hsphere/local/home/c327781/sibertec.com/includes/bootstrap.inc).
  • Warning: Cannot modify header information - headers already sent by (output started at /hsphere/local/home/c327781/sibertec.com/index.php:1) in drupal_send_headers() (line 1485 of /hsphere/local/home/c327781/sibertec.com/includes/bootstrap.inc).
  • Warning: Cannot modify header information - headers already sent by (output started at /hsphere/local/home/c327781/sibertec.com/index.php:1) in drupal_send_headers() (line 1485 of /hsphere/local/home/c327781/sibertec.com/includes/bootstrap.inc).
  • Warning: Cannot modify header information - headers already sent by (output started at /hsphere/local/home/c327781/sibertec.com/index.php:1) in drupal_send_headers() (line 1485 of /hsphere/local/home/c327781/sibertec.com/includes/bootstrap.inc).

A Way to Correctly Round Currency with MySQL

After a lot of searching to a solution to the "rounding to even" feature that incorrectly rounds currency using the standard MySQL functions, I finally found a solution that looks very promising. Hopefully this will save someone time and frustration.


set @value = 22.725; 

select round(@value, 2) as incorrect,
    round(truncate(@value, 3) + 0.0001, 2) as correct;

Tags: