how can i set it 24
please give me solution
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Satyapriya NayakRank #47 · 31.5K reputationPosted Feb 13, 2013, 8:40 PM EST
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);
}
}
}
}
Jignesh TrivediRank #16 · 50.3K reputationPosted Feb 13, 2013, 9:26 PM EST
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.