Results 1 to 3 of 3
Thread: why wont the %.2f work here?
- 03-06-2011, 04:24 AM #1
Member
- Join Date
- Feb 2011
- Posts
- 71
- Rep Power
- 0
- 03-06-2011, 05:32 AM #2
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,547
- Rep Power
- 11
You're sort of mixing printf() and print()-style concatenation. WHat you do is put *all* of the content into the format string:
Java Code:System.out.printf("Sorry, you need $%.2f more.%n", cashNeeded);
- 03-06-2011, 05:55 AM #3
Member
- Join Date
- Feb 2011
- Posts
- 71
- Rep Power
- 0
Similar Threads
-
importing JCurses wont work!
By TheBreadCat in forum New To JavaReplies: 0Last Post: 02-16-2011, 08:46 PM -
class that wont work out properly.
By vampire-elf in forum New To JavaReplies: 7Last Post: 09-07-2010, 01:39 AM -
JApplet buttons wont work
By Mark101 in forum New To JavaReplies: 3Last Post: 03-16-2010, 06:53 PM -
Why wont import jm.util.*; work??
By cakepizza in forum New To JavaReplies: 2Last Post: 01-01-2010, 11:19 PM -
save will work but load wont?!?!
By Sticks_ll in forum New To JavaReplies: 1Last Post: 06-12-2008, 04:19 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks