Home ROUND function in mySql giving strange result after using TRUNCATE
 I am using a stored procedure in mysql to set the following value to a double variable.  DECLARE vVar DOUBLE(16,2) DEFAULT 0; SET vVar = ROUND(TRUNCATE((29.00 * 1.75/100),2));  Firing the above expression in mySql editor gives 1 (which is correct, since ROUND(0.50) would give 1). However, the value that gets stored in vVar is 0. On the other hand, if I write SET vVar = ROUND(TRUNCATE((29.00 * 1.75/100),4));  then the value that gets stored in vVar becomes 1. (which is also correct, since ROUND(0.5075) is 1). Could someone please explain the strange behavior occurring here. I had a doubt regarding the datatype of vVar, so I tried changing it from DOUBLE(16,2) to DECIMAL(16,2). But it did not make any difference. Is there a way to get 1 from the first expression ?  SET vVar = ROUND(TRUNCATE((29.00 * 1.75/100),2));  Any help would be appreciated.