How to save decimal in java

Initialize your variable with an expression that evaluates to a double rather than an int:

double operation = 890.0 / 1440.0;

Otherwise the expression is done using integer arithmetic (which ends up truncating the result). That truncated result then gets converted to a double.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)