From: hiwa (HGA03630_at_nifty.ne.jp)
Date: 16 Jan 2004 17:20:01 -0800
"martin" <firstname.lastname@example.org> wrote in message news:<email@example.com>...
> ... = 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.