I want to format a double value into a style of having
- Currency Format Symbol
- Value rounded into 2 decimal places
- Final Value with thousand separator
Specifically using the java.util.Formatter class
Example :-
double amount = 5896324555.59235328;
String finalAmount = "";
// Some coding
System.out.println("Amount is - " + finalAmount);
Should be like :-
Amount is - $ 5,896,324,555.60
I searched, but I couldn't understand the Oracle documentations or other tutorials a lot, and I found this link which is very close to my requirement but it's not in Java - How to format double value into string with 2 decimal places after dot and with separators of thousands?