Answer the question
In order to leave comments, you need to log in
How to increase only the integer part of the amount?
Hello, in the database the amount of goods is stored as 71207.0000. It needs to be increased by 3%. After sql query it is 73343.2100. How to increase the sum, affecting only the integer part of the number? Now the sql is like this:
UPDATE `oc_product` SET price=price*1.03;
Answer the question
In order to leave comments, you need to log in
to start with, STORE MONEY AMOUNT ONLY BIGINT in minimum units (penny, cents)
SELECT CEILING( 71207.0000 * 1.03), FLOOR( 71207.0000 * 1.03 )
73344 73343
SELECT FLOOR( 71207.0000 ) + FLOOR( FLOOR( 71207.0000 ) * 0.03 )
73343
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question