I am writing a small code in java about finding a square root of a number! I should have the facility to decide how many decimal numbers will be shown after decimal points! Is there any method by which I can select how many position to show in the answer? I have declared all the variables as double but still it is showing answer up to 15 digits only! I want another method by which I can show “n” number of digits after the decimal point! Thanks!
Bookmarks