AalborgHTX

Variabler af typen float og double

Dec 15th, 2020
683
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.74 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. namespace WindowsFormsApp11
  12. {
  13.     public partial class Form1 : Form
  14.     {
  15.         float minFloatTal = 5.75F;
  16.         double minDoubleTal = 5.75595959;
  17.         public Form1()
  18.         {
  19.             InitializeComponent();
  20.         }
  21.  
  22.         private void btnKnap_Click(object sender, EventArgs e)
  23.         {
  24.             minDoubleTal = 1.1234567890;
  25.             lblUd1.Text = minDoubleTal.ToString();
  26.  
  27.             minFloatTal = (float) minDoubleTal;
  28.             lblbUd2.Text = minFloatTal.ToString();
  29.         }
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment