Date: Sat, 15 Aug 1998 22:19:59 GMT
From: <###@###.###>
Subject: IO Issue: numeric text output
Name: Doug Lutterloh
Email: ###@###.###
Phone Number: 513-530-0745
Location: North America
System: Linux
Referring URL: http://www.javasoft.com/nav/developer/index.html
I use Java to write stand alone apps that sometimes
require formatted text output. For example,
I may want a table of numeric results such as:
1 5.67 456.442
2 .59 -7.300
...
With C, I could use the "printf" command and specify
the maximum field width of each number, precision,
left/right justification, scientific notation, etc.
Java seems to have no comparable functionality. Printing
numeric results with precise control of length, spacing,
etc. seems impossible with Java at this time. This
is a real problem for those of us who are trying to use
Java for scientific/mathematical applications instead
of just web toys.
--------
From: James L Espinosa <###@###.###>
To: "'###@###.###'" <###@###.###>
Subject: Printing a double data type number with a rounded number of signi
ficat digits
Date: Tue, 22 Sep 1998 17:19:01 -0500
Dear Sirs,
I have a program that has a variable with a data type of
double. It gets a value of 4.47213595 and I want
to print it as a number with four significant digits and rounded. In
this example, I would want the number to
print as 4.4721. How can I do this. I am using JDK1.1.6 and have tried
to find the information in the online
help but I cannot find it. Can you help?
From: <###@###.###>
Subject: IO Issue: numeric text output
Name: Doug Lutterloh
Email: ###@###.###
Phone Number: 513-530-0745
Location: North America
System: Linux
Referring URL: http://www.javasoft.com/nav/developer/index.html
I use Java to write stand alone apps that sometimes
require formatted text output. For example,
I may want a table of numeric results such as:
1 5.67 456.442
2 .59 -7.300
...
With C, I could use the "printf" command and specify
the maximum field width of each number, precision,
left/right justification, scientific notation, etc.
Java seems to have no comparable functionality. Printing
numeric results with precise control of length, spacing,
etc. seems impossible with Java at this time. This
is a real problem for those of us who are trying to use
Java for scientific/mathematical applications instead
of just web toys.
--------
From: James L Espinosa <###@###.###>
To: "'###@###.###'" <###@###.###>
Subject: Printing a double data type number with a rounded number of signi
ficat digits
Date: Tue, 22 Sep 1998 17:19:01 -0500
Dear Sirs,
I have a program that has a variable with a data type of
double. It gets a value of 4.47213595 and I want
to print it as a number with four significant digits and rounded. In
this example, I would want the number to
print as 4.4721. How can I do this. I am using JDK1.1.6 and have tried
to find the information in the online
help but I cannot find it. Can you help?
- duplicates
-
JDK-4313885 Scanning and formatting [scanning]
- Resolved