#String formating
50 messages · Page 1 of 1 (latest)
⌛ This post has been reserved for your question.
Hey @solid jay! Please use
/closeor theClose Postbutton above when you're finished. 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.
l
why you use %f but then pass another string (but float was expected)
so class main can print it out
you do all the format in the first string argument, and then just pass another argumens
can u send an example
I mean you do format("$f, %f ...", "here if do another string and concat it with a " + someFloat)
could you send the text code
not image
String.format("Float number is %f and another is %f\n", 3.14, 2.7);
huh
im trying to limit all the variables to 3 decimals
do I replace all the + with , ?
use %.3f for that
instead of concatinating string, put %.3f into first string, and pass a float that will be shown in that place
but it is one of the easiest way
so this code is good enough
you can use stringbuilder if you need to but idk tho
another javascript feature i want in java
lmao you're still on this
js doesn't have formatting.
blah blah has ${money} and owns ${beans} beans
anyways, this guy's already been answered but refuses to learn to use the answers lol
string interp is different from formatting. string formatting supports specifying a lot more
yeah i misread it
I cant
my assignment requires me to
do it in a very specific way
and you refuse to learn how 

…maybe language barrier?
idk
see?