|
 |
asptoday_discuss thread: outputing a calculation
Message #1 by "Tan Chye Ting" <chyeting18@h...> on Sun, 13 Jan 2002 07:43:10
|
|
i'm trying to output my calculation in a more presentable form
say 12.1333222111
to 12.13
how to round up the number?
Message #2 by "Douglas Rohm" <dlr@m...> on Sun, 13 Jan 2002 02:50:58 -0500
|
|
In C#:
decimal myDec = 12.1333222111;
decimal myNewDec = Math.Round(myDec, 2);
myLabel.Text = myNewDec.ToString();
This should output 12.13.
-----Original Message-----
From: Tan Chye Ting [mailto:chyeting18@h...]
Sent: Sunday, January 13, 2002 7:43 AM
To: ASPToday Discuss
Subject: [asptoday_discuss] outputing a calculation
i'm trying to output my calculation in a more presentable form
say 12.1333222111
to 12.13
how to round up the number?
Message #3 by "Patrick" <patrick00@n...> on Sun, 13 Jan 2002 08:45:56 -0000
|
|
Try this one
FormatNumber(rs("price"),2)
or
FormatNumber((p*n),2)
----- Original Message -----
From: "Tan Chye Ting" <chyeting18@h...>
To: "ASPToday Discuss" <asptoday_discuss@p...>
Sent: Sunday, January 13, 2002 7:43 AM
Subject: [asptoday_discuss] outputing a calculation
> i'm trying to output my calculation in a more presentable form
>
> say 12.1333222111
> to 12.13
>
> how to round up the number?
>
Message #4 by "Rich McQuaid" <remcq@m...> on Wed, 16 Jan 2002 07:16:05 -0500
|
|
The formatnumber function will do this:
Fromatnumber(NumbertoFormat,NumberofdDecimalPlaces, Options)
-----Original Message-----
From: Tan Chye Ting [mailto:chyeting18@h...]
Sent: Sunday, January 13, 2002 7:43 AM
To: ASPToday Discuss
Subject: [asptoday_discuss] outputing a calculation
i'm trying to output my calculation in a more presentable form
say 12.1333222111
to 12.13
how to round up the number?
|
|
 |