title: How to set Decimal Value in a Dataset in C#?
body: <p>I have a Column AMOUNT_PAISE in Dataset. I'm binding this dataset from the result set coming from sql server stored procedure. for AMOUNT_PAISE  column in DB currency is in paise(lets say 888 paise for a particular row) but I want to display this amount in Rupees(Rupee equivalenof 888 paise is 8.88). But I can not directly assign it, because dataset contains int64 values. when I convert decimal 888 to int64 it gives 9 (888/100 = 8.88 and when converted to int64 it gives 9)
  So Please tell me what should I try now. </p>
  
  <p>formula to convert from paise to rupee.</p>
  
  <pre><code>rupee = paise/ 100; //upto 2 decimal points
  
  if (dsTransactionLogs.Tables.Count &gt; 0)
  {
      if (dsTransactionLogs.Tables[0].Rows.Count &gt; 0)
      {
  
          //Code to convert amount from Paise to Rs.
          int i = 0;
          foreach (DataRow row in dsTransactionLogs.Tables[0].Rows)
          {
              decimal decimalAmountInPaise = Convert.ToDecimal(dsTransactionLogs.Tables[0].Rows[i]["AMOUNT_PAISE"]);
              decimalAmountInPaise = Math.Round(decimalAmountInPaise / 100, 2);
              //Int64 int64AmountInPaise = Convert.ToInt64(decimalAmountInPaise);
              string strAmount = decimalAmountInPaise.ToString("#.##");
              dsTransactionLogs.Tables[0].Rows[i]["AMOUNT_PAISE"] = Convert.ToInt64(strAmount);
              i++;
  
          }
  
          GridViewTRANSACTIONDETAILS.DataSource = dsTransactionLogs;
          GridViewTRANSACTIONDETAILS.DataBind();
          transactionGVDiv.Style.Add("height", "400px");
          //LabelNoTransactionLogsID.Visible = false;
      }
      else
      {
          //LabelNoTransactionLogsID.Visible = true;
      }
  }
  </code></pre>
  
  <p>this is aspx code for this column in gridview.</p>
  
  <pre><code>&lt;asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Amount"&gt; 
  &lt;ItemTemplate&gt; 
      &lt;asp:Label runat="server" ID="AmountLbl" NavigateUrl="#" Text='&lt;%#Eval("AMOUNT_PAISE") %&gt;'&gt; &gt;&lt;/asp:Label&gt;
  &lt;/ItemTemplate&gt;
  &lt;/asp:TemplateField&gt;
  </code></pre>