Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can i get decimal point value in asp.net

Please help me.


Thanks.
Posted
Updated 31-Jan-12 23:19pm
v2
Comments
CRDave1988 1-Feb-12 5:17am    
Please clear ur question.
Rajesh Anuhya 1-Feb-12 5:19am    
Not a clear Question,
--RA
[no name] 1-Feb-12 5:40am    
but whats the question!
please explain briefly!
JBSAHU 1-Feb-12 5:46am    
suppose I have 345.78

then I will Display only 0.78

Not sure I get your question correctly but using Decimal.Parse() can convert string to a decimal.
You can also consider using Decimal.TryParse().
 
Share this answer
 
Hi,you have few ways,
you van boxing.
C#
decimal val = 5.56;
float f = (float)val;


Or
C#
Convert.ToDecimal();


Or
C#
Decimal.Parse();


or
C#
Decimal.TryParse();


it just depend on the requirement you have.
 
Share this answer
 
Something like this ?

C#
decimal Value = 1234567.8908888m;
Response.Write(decimal.Remainder(decimal.Round(Value,2,MidpointRounding.AwayFromZero) ,1));
 
Share this answer
 
C#
decimal v = 2.25;
int i = v;
v= v - i
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900