| Author |
Formatting strings as money format
|
Pho Tek
Ranch Hand
Joined: Nov 05, 2000
Posts: 757
|
|
I have strings read from the database in decimal format e.g. 48.0 which I want to format as money e.g. 48.00 There must be some class that does this in Java 1.2 ? Thanks Pho
|
Regards,
Pho
|
 |
Bosun Bello
Ranch Hand
Joined: Nov 06, 2000
Posts: 1506
|
|
Check out the DecimalFormat class in the java.text package. Bosun
|
Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
|
 |
Pho Tek
Ranch Hand
Joined: Nov 05, 2000
Posts: 757
|
|
Hi Bosun, I tried to write a simple program using NumberFormat like this: But I continually get a ParseException. What goes ? Thanks Pho
|
 |
Cindy Glass
"The Hood"
Sheriff
Joined: Sep 29, 2000
Posts: 8521
|
|
Try it this way:
|
"JavaRanch, where the deer and the Certified play" - David O'Meara
|
 |
 |
|
|
subject: Formatting strings as money format
|
|
|