XploreDotNet
Known Is A Drop,UnKnown Is An Ocean....
Njoy Programming
Monday, January 12, 2009
how to fix decimal places
Decimal.Round
method used to a specified number of decimal places.
decimal
.
Round
(99.2789m ,2).ToString();
Note
Without the suffix
m
, the number is treated as a
double
, thus generating a compiler error.
Output
99.28
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
Loading...
No comments:
Post a Comment