Re: Rounding off a float to two decimal places
From: Margaret (Rita_Shpilsky_at_hvbamericas.com)
Date: 10/09/03
- Next message: Jack Smith: "divide and conquer"
- Previous message: PerfectDayToChaseTornados: "Re: Using MOD_JK2 to connect Apache to Tomcat"
- In reply to: Joe M Blow: "Rounding off a float to two decimal places"
- Next in thread: DaiIchi: "Re: Rounding off a float to two decimal places"
- Reply: DaiIchi: "Re: Rounding off a float to two decimal places"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 9 Oct 2003 10:42:56 -0700
DecimalFormat df2 = new DecimalFormat( "#,###,###,##0.00" );
double dd = 100.2397;
double dd2dec = new Double(df2.format(dd)).doubleValue();
The value of dd2dec will be 100.24
"Joe M Blow" <joemblow@rogers.com> wrote in message news:<rI%gb.261229$Lnr1.5787@news01.bloor.is.net.cable.rogers.com>...
> Hi evreyone
>
> I just want to kno how to make my value (a float) and round it off to two
> decimal places
>
>
> Thanks alot
>
> Ty
- Next message: Jack Smith: "divide and conquer"
- Previous message: PerfectDayToChaseTornados: "Re: Using MOD_JK2 to connect Apache to Tomcat"
- In reply to: Joe M Blow: "Rounding off a float to two decimal places"
- Next in thread: DaiIchi: "Re: Rounding off a float to two decimal places"
- Reply: DaiIchi: "Re: Rounding off a float to two decimal places"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]