2
I am making a financial system, but due to insecurity and ignorance of the subject, I have the following doubt...
Let’s assume that: We have a value of R $ 1299,99 or similar.
What would be the ideal way to divide the plots to register in a BD?
12 installments of R $ 1299,99? (Daria R $ 108,3325)
I would like to store only 2 digits after the comma.
FOLLOWING THE LOGIC OF THE DATABASE:
CREATE TABLE TRANSACAO (
codigo INT AUTO_INCREMENT,
PRIMARY KEY (codigo)
);
CREATE TABLE TRANSACAO_PARCELA (
codigo INT AUTO_INCREMENT,
valor DOUBLE(11,2) NOT NULL,
cod_transacao INT,
FOREIGN KEY(cod_transacao),
PRIMARY KEY (codigo)
);
I would like suggestions or examples of how I can do this procedure.
Very good, and thank you very much!
– André Felipe