In java if we have a number, which is double, like this 0.619879223757707784592145.
It will show it as 6.19879223757707e-4, when you print that number.
I am asking that whether i can print this number as 0.000619.
In C#, we can use the code below
Console.WriteLine("Number{3:0.000000}",num);//output: 0.000619
In Java, we can write this as below
System.out.printf("%.6f\n",num);//output:0.000619
But my question is how to truncate and store that value in a database or a file in java?
The above solutions only answers how to print that value(0.000619) in a command prompt.But I want to truncate as well as store the value in a file or a database, at the same time.