how can i set it 24
please give me solution
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jignesh TrivediPosted Feb 14, 2013, 2:26 AM
Rajeev,
Can please share error which you got?
so that we can help you.
yes you can round you decimal point using Math.Round(value) and decimal.Round(Value, 2, MidpointRounding.AwayFromZero);
or Decimal.Floor or Math.Floor methods.
it all are depanding on your Requirement.
hope this will help you.
Satyapriya NayakPosted Feb 14, 2013, 1:40 AM
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication3
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
string s1 = textBox1.Text;
decimal value;
if (decimal.TryParse(s1, out value))
{
value = Math.Round(value);
s1 = value.ToString();
MessageBox.Show(s1);
}
}
}
}