MySQL Forums
Forum List  »  Italian

Arrotondamento numeri
Posted by: Andrea Tarquini
Date: September 19, 2014 04:00AM

Ciao, ho un problema con una funzione, gli passo un valore che proviene da un campo decima di una tabella, faccio fare delle operazioni all'interno della funzione, ma i valori che mi restituisce non sono veri. Ho verificato che se faccio un return del valore che passo alla funzione, mi restituisce un arrotondamento per eccesso.
Una parte di codice è questa,


CREATE DEFINER = `root`@`localhost` FUNCTION `calcolaDifferenzaFTACQ` (
`imponibile` DECIMAL( 7, 2 ),
.....
.....

il valore che gli arriva ad imponibile è 111.63, il return appena sotto mi da 112, com'è possibile evitare questo arrotondamento? i campi sono tutti decimal.

grazie.

Options: ReplyQuote


Subject
Views
Written By
Posted
Arrotondamento numeri
2108
September 19, 2014 04:00AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.