Answer:
// Program to convert rounded decimal to string
// This program segment is written in Java programming language
// Comments are used for explanatory purpose
// Program starts here
import java.text.D ecimalFormat;
public class RoundNumbers
{
public static void main(String[] args) {
// Declare number and assign value to it
double cv = 18.7713;
// Call decimalformat method
DecimalFormat commaType = new DecimalFormat("#,###.###");
//Convert cv to string
String myPi = commaFormat.format(cv);
// Print result
System.out.println(commaType.format(cv));
}
}
// End of Program