I'm working in a Sybase database.Before I was trying to Round using SQL Round function but Some data mismatch problem I need to build a java function which returns a Round value of database outputs.
SQL Query :-
With Round :- select Country,Round(ISNULL(sum(value),0),1) as Round_Value from Database ## Result :- 15012.8
Without Round :- select Country,sum(value) as Without_Round from Database ## Result :- 15012.82906
Now when I'm trying to Round the database value(Without Round Value) using java function then getting the below result ...
Java :-
public static void main(String []args)
{
double value=15012.82906;
System.out.println("Test Value:"+ Math.round(value));##Result :- 15013
}
Is there any way to get the same value from SQL database and Java round function ? Thanks in advance.