本文整理汇总了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();
}
示例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));
}
}
示例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;
}
示例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");
}
示例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 ) );
}
示例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);
}));
}
示例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();
}
示例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;
}
示例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;
}
}
}
}
}
示例10: ConvertToDBString
public static String ConvertToDBString(Double? d, string val)
{
if (d != null)
{
val = d.ToString();
}
return ((val == null) ? "null" : val.Replace("'", "''"));
}
示例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"));
}
示例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 = "-- %";
}
示例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();
}
示例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());
}
}
示例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 = "";
}