Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- double x = 1493.1987;
- string s1 = x.ToString("F3");
- string s2 = string.Format("Your total is {0:F3}, have a nice day.", x);
- // s1 is "1493.199"
- // s2 is "Your total is 1493.199, have a nice day."
- double y = 1493;
- string s3 = y.ToString("F3");
- // s3 is "1493.000"
- double pi = 3.1415927;
- string output = pi.ToString("#.000");
- float a = 12.3578f;
- double b = 12.3578d;
- Console.WriteLine("The tolerance specs are: {0:F4} and: {1:F3}", a,b);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement