当前位置: 首页>>代码示例>>C#>>正文


C# Double.ToString方法代码示例

本文整理汇总了C#中System.Double.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Double.ToString方法的具体用法?C# Double.ToString怎么用?C# Double.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Double的用法示例。


在下文中一共展示了Double.ToString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: adicionar_num

 public void adicionar_num(Double number)
 {
     //?implementar mais codigos?
      //se o resultado for diferente de zero E não houver sinal operação aritmetica, concatenar esse valor ao número passado por parametro aqui
     this.textBox += number.ToString();
     this.lastOperation += number.ToString();
 }
开发者ID:ZeroZXZ,项目名称:Scientific-Calculator,代码行数:7,代码来源:calculator_buffer.cs

示例2: ToJson

 public static MutableString ToJson(Double self, GeneratorState state)
 {
     if (Double.IsInfinity(self) || Double.IsNaN(self)) {
         if (state != null && state.AllowNaN == false) {
             Helpers.ThrowGenerateException(String.Format("{0} not allowed in JSON", self));
         }
         return MutableString.CreateAscii(self.ToString(NumberFormatInfo.InvariantInfo));
     }
     else {
         return MutableString.CreateAscii(self.ToString(NumberFormatInfo.InvariantInfo));
     }
 }
开发者ID:nrk,项目名称:ironruby-json,代码行数:12,代码来源:Generator.Float.cs

示例3: CreateUrl

        private string CreateUrl(
            String Query, 
            Double? Latitude = null, 
            Double? Longitude = null, 
            String Market = "", 
            String Adult = "Strict", 
            String WebFileType = "", 
            String ImageFilters = "Size:Medium", 
            String VideoFilters = "", 
            String VideoSortBy = "", 
            String NewsLocationOverride = "", 
            String NewsCategory = "", 
            String NewsSortBy = "")
        {
            string _Url = "https://api.datamarket.azure.com/Data.ashx/Bing/Search/v1/Image?$format=atom&";

            _Url += (string.IsNullOrWhiteSpace(Query)) ? string.Empty : string.Format("Query='{0}'&", System.Uri.EscapeDataString(Query));
            _Url += (string.IsNullOrWhiteSpace(Market)) ? string.Empty : string.Format("Market='{0}'&", System.Uri.EscapeDataString(Market));
            _Url += (string.IsNullOrWhiteSpace(Adult)) ? string.Empty : string.Format("Adult='{0}'&", System.Uri.EscapeDataString(Adult));
            _Url += (!Latitude.HasValue) ? string.Empty : string.Format("Latitude='{0}'&", System.Uri.EscapeDataString(Latitude.ToString()));
            _Url += (!Longitude.HasValue) ? string.Empty : string.Format("Longitude='{0}'&", System.Uri.EscapeDataString(Longitude.ToString()));
            _Url += (string.IsNullOrWhiteSpace(WebFileType)) ? string.Empty : string.Format("WebFileType='{0}'&", System.Uri.EscapeDataString(WebFileType));
            _Url += (string.IsNullOrWhiteSpace(ImageFilters)) ? string.Empty : string.Format("ImageFilters='{0}'&", System.Uri.EscapeDataString(ImageFilters));
            _Url += (string.IsNullOrWhiteSpace(VideoFilters)) ? string.Empty : string.Format("VideoFilters='{0}'&", System.Uri.EscapeDataString(VideoFilters));
            _Url += (string.IsNullOrWhiteSpace(VideoSortBy)) ? string.Empty : string.Format("VideoSortBy='{0}'&", System.Uri.EscapeDataString(VideoSortBy));
            _Url += (string.IsNullOrWhiteSpace(NewsLocationOverride)) ? string.Empty : string.Format("NewsLocationOverride='{0}'&", System.Uri.EscapeDataString(NewsLocationOverride));
            _Url += (string.IsNullOrWhiteSpace(NewsCategory)) ? string.Empty : string.Format("NewsCategory='{0}'&", System.Uri.EscapeDataString(NewsCategory));
            _Url += (string.IsNullOrWhiteSpace(NewsSortBy)) ? string.Empty : string.Format("NewsSortBy='{0}'&", System.Uri.EscapeDataString(NewsSortBy));
            _Url = _Url.TrimEnd('&');

            return _Url;
        }
开发者ID:MrLeebo,项目名称:Hackathon,代码行数:32,代码来源:BingService.cs

示例4: Course

 public Course(
     Int64 id, 
     String name, 
     String description, 
     Double units, 
     Boolean isLaboratory, 
     Boolean isServiceCourse,
     AvailabilityEnum availability)
 {
     this.id = id;
     this.name = name;
     this.description = description;
     this.units = units;
     this.isLaboratory = isLaboratory;
     this.isServiceCourse = isServiceCourse;
     this.availability = availability;
     SubItems[0].Text = name.ToString();
     SubItems.Add(description.ToString());
     SubItems.Add(units.ToString());
     SubItems.Add(isLaboratory ? "Yes" : "No");
     SubItems.Add(isServiceCourse ? "Yes" : "No");
     SubItems.Add(availability == AvailabilityEnum.EverySemester ? "Every Semester" :
                 availability == AvailabilityEnum.FirstSemesterOnly ? "1st Semester Only" :
                     "2nd Semester Only");
 }
开发者ID:jmeroy03,项目名称:scheduler,代码行数:25,代码来源:Course.cs

示例5: FormatearNumero

 public static string FormatearNumero(this HtmlHelper html, Double _cifra)
 {
     NumberFormatInfo nfi = new CultureInfo("en-US", false ).NumberFormat;
     nfi.NumberDecimalSeparator = ",";
     nfi.NumberGroupSeparator = ".";
     return(_cifra.ToString( "N", nfi ) );
 }
开发者ID:CarlosLeones,项目名称:vecoweb,代码行数:7,代码来源:HMTLHelperExtensions.cs

示例6: WritePathCostToTextBox

 private void WritePathCostToTextBox(Double cost)
 {
     Application.Current.Dispatcher.Invoke(new Action(() =>
         {
             Logger.WriteLogInfo(string.Format("Total path cost: {0}",cost)); 
             this.pathCostTextBox.Text = cost.ToString(CultureInfo.InvariantCulture); 
         }));
 }
开发者ID:DVitinnik,项目名称:UniversityApps,代码行数:8,代码来源:MainWindow.xaml.cs

示例7: btnView_Click

 private void btnView_Click(object sender, EventArgs e)
 {
     Double t = Convert.ToDouble(lblTotalMark.Text);
     Double ot = Convert.ToDouble(lblObtainedTotal.Text);
     Percent = ot / t * 100;
     lblPercent.Text = Percent.ToString();
    
 }
开发者ID:asangam,项目名称:ResultDataGridView,代码行数:8,代码来源:Form1.cs

示例8: DrawTextBox

 internal Boolean DrawTextBox(ref Double dblVar, GUIStyle style, params GUILayoutOption[] options)
 {
     String strRef = dblVar.ToString();
     DrawTextBox(ref strRef, style, options);
     Double dblOld = dblVar;
     dblVar = Convert.ToDouble(strRef);
     return false;
 }
开发者ID:Kerbas-ad-astra,项目名称:KSPTips,代码行数:8,代码来源:TipsWindowDebug.cs

示例9: idleManage

        public void idleManage(object sender, EventArgs e, Form1 form)
        {
            if (form.isCurrentlySheetActive() || isInPause)
            {
                Double idle = this.tmrIdle_Tick(sender, e);

                int paramIdleTime = Properties.Settings.Default.idelTime;

                //900000 = 15 min
                if (idle >= (paramIdleTime * 60) && isInPause == false)
                {
                    isInPause = true;
                    form.setDebutMessage("in pause now");

                    //Save current sheet to restart it
                    this.lastSheet = ProjectRepository.getInstance().actualSheet;

                    //Stop current sheet
                    form.stopCurrentSheet(paramIdleTime);
                }

                if (isInPause)
                {
                    if (idle > currentIdleTime)
                    {
                        currentIdleTime = idle;
                        form.setDebutMessage("in pause: currentIdle = " + currentIdleTime.ToString());
                    }
                    else {
                        DateTime startActive = new DateTime();
                        startActive = DateTime.Today.Add(Properties.Settings.Default.activeTimeFrom);

                        DateTime stopActive = new DateTime();
                        stopActive = DateTime.Today.Add(Properties.Settings.Default.activeTimeTo);

                        currentIdleTime = 0;

                        if (DateTime.Now.CompareTo(startActive) >= 0 && DateTime.Now.CompareTo(stopActive) <= 0)
                        {

                            isInPause = false;
                            form.setDebutMessage("out of pause");
                            //Restart last sheet
                            Sheet actualSheet = new Sheet();
                            actualSheet.start = DateTime.Now;
                            actualSheet.job = lastSheet.job;
                            actualSheet.job.task = lastSheet.job.task;

                            form.startSheet(actualSheet);
                        }
                        else
                        {
                            isInPause = false;
                        }
                    }
                }
            }
        }
开发者ID:JonasFlc,项目名称:TimeSheetControl,代码行数:58,代码来源:IdleManagment.cs

示例10: ConvertToDBString

        public static String ConvertToDBString(Double? d, string val)
        {
            if (d != null)
            {
                val = d.ToString();
            }

            return ((val == null) ? "null" : val.Replace("'", "''"));
        }
开发者ID:seifeet,项目名称:schoolparser,代码行数:9,代码来源:Util.cs

示例11: Collectable

        public Collectable(Game game, Location location, Double lifeTime, CollectableEntityType collectableEntityType)
            : base(game)
        {
            this.collectableEntityType = collectableEntityType;
            this.Location = location;
            this.IsCollected = false;
            this.LifeTime = lifeTime;

            Console.WriteLine("Collectable Spawned: " + lifeTime.ToString("F2"));
        }
开发者ID:bstockus,项目名称:WarehouseZombieAttack,代码行数:10,代码来源:Collectable.cs

示例12: FormDownloadUpdate

        public FormDownloadUpdate(Main wmain, Uri url, Double nv, Double ov)
        {
            InitializeComponent();
            fmain = wmain;
            this.url = url;
            if (nv.ToString().Length > 3)
            {
                this.nv = nv.ToString().Replace(',', '.');
            }
            else
            {
                this.nv = nv.ToString().Replace(',', '.') + "0";
            }

            this.ov = ov;
            labelDownloaded.Text = "-- MB's / -- MB's";
            labelSpeed.Text = "-- kb/s";
            labelPerc.Text = "-- %";
        }
开发者ID:ricain59,项目名称:fortaff,代码行数:19,代码来源:FormDownloadUpdate.cs

示例13: frmContinuousEditor

        public frmContinuousEditor(String name, Double bl, Double tl, Double tr, Double br)
        {
            InitializeComponent();

            txtLinguistic.Text = name;
            txtBottomLeft.Text = bl.ToString();
            txtTopLeft.Text = tl.ToString();
            txtTopRight.Text = tr.ToString();
            txtBottomRight.Text = br.ToString();
        }
开发者ID:ltvinh,项目名称:FRDB-SQLite,代码行数:10,代码来源:frmContinuousEditor.cs

示例14: HabitacionAlta

 public HabitacionAlta(SQLConnector conec,Double id)
 {
     InitializeComponent();
     conexion = conec;
     txtHotel.Text = id.ToString();
     DataTable tiposHab = conexion.consulta("select Tipo_Hab_Desc from NENE_MALLOC.Tipo_Habitacion");
     foreach(DataRow dr in tiposHab.Rows){
         cBTipoHabitacion.Items.Add(dr["Tipo_Hab_Desc"].ToString());
     }
 }
开发者ID:gastitan,项目名称:NENE_MALLOC,代码行数:10,代码来源:AltaHabitacion.cs

示例15: btn_close_Click

 private void btn_close_Click(object sender, EventArgs e)
 {
     if (txt_num.Text.Length > 0)
     {
         n = Convert.ToDouble(txt_num.Text);
         txt.Text = n.ToString();
     }
     this.Hide();
     txt_num.Text = "";
 }
开发者ID:phhui,项目名称:SalesManage,代码行数:10,代码来源:NumberInput.cs


注:本文中的System.Double.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。