From: hiwa (HGA03630_at_nifty.ne.jp)
Date: 16 Jan 2004 17:20:01 -0800
"martin" <email@example.com> wrote in message news:<firstname.lastname@example.org>...
> ... = yet another simple question. ;-))
> when I have -for example- a 'double' variable with value
> 231.6847987639475639876478 etc...
> How can I have it printed on screen as 231.685 ?
> or as 2.3e+2 ?
> in general: How can I set the format in which floats (or other var's) are
> printed on screen?
> thanx in advance!
Use java.text.DecimalFormat. Its usage is quite simple and easy.