c# - Display data from decimal to integer -


in database show column "value" 0.06 datatype decimal(18,2).

how can display in textbox value value 6 not 0.06?

i try change format {0} not successful. if used convert, how can convert it?

<input type="text" runat="server" title="value" id="value" name="value"/>  protected string r_value = string.empty; protected void page_load(object sender, eventargs e)     {          if (string.format("{0}",request.params["value"]) != null) r_value =  string.format("{0}",request.params["value"]);       if (!ispostback)         {                        list_detail();          }     }   private void list_detail()     {         try         {             bizevalue biz = new bizevalue();             dataset ds = biz.spvalue(r_ven);              if (ds.tables[0].rows.count > 0)             {                  datarow row = ds.tables[0].rows[0];                  value.value = string.format("{0}", row["value"]) != null ? string.format("{0}", row["value"]) : "";                    }          }         catch (exception ex)         {             base.scriptalert("raised exception");         }      } 

how can display in textbox value value 6 not 0.06?

if try cast 0.06 integer, 0.

it sounds trying convert decimal value in range 0.0 1.0 percentage in range 0 100. multiply decimal value 100 before casting integer.


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -