#Printing the correct amount of decimal spaces

1 messages · Page 1 of 1 (latest)

forest inletBOT
#

This post has been reserved for your question.

Hey @midnight shadow! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

stuck haven
#

well how many do you want?

#

doubles will print decimal places unless you specify them not to, use .0 as the precision to remove it

#

/run

System.out.printf("%.0f\n", 1.9);
winged cobaltBOT
#

Here is your java(15.0.2) output @stuck haven

2
stuck haven
#

well you have that don't you

#

just the distances are 6-decimal precision since that's the default

stuck haven
forest inletBOT
#

If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.

forest inletBOT
#

💤 Post marked as dormant

This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping.
Warning: abusing this will result in moderative actions taken against you.