I have a DECIMAL(18,3) field that I multiply with 12, using a trigger. Using any calculator would return for example 644.8 * 12 = 7737.6. but MySQL returns 7738. What gives?
Trigger:
SET NEW.Perannum = NEW.Wage * 12;
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Try multiplying by 12.00 to ensure a decimal value * a decimal value…