0
How to make a number print out up to N decimal numbers
Im trying to make a program to print out a number up to the amount of decimal points the user inputs. I only know the format method which uses % , but how can I use the number its inputted to make the print out ?
2 Answers
0
123.45678 -> %.2f // output: 123.45
0
yes but what about using a value stored in a variable to know how many spaces it will choose a a decimal. for example the user chose to have 3 decimals and its stored in a variable called decimal how do I write it with that code.