Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
C# get decimal part only form double extension
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public static class DoubleExtensions { public static string ReminderDigits(this Double number, int count) { string decimalPart = (number - Math.Truncate(number)).ToString(); return decimalPart.Substring(2, count > decimalPart.Length ? decimalPart.Length : count); } } public class Program { public static void Main(string[] args) { double number = 98.45673879; Console.WriteLine(number.ReminderDigits(3)); } } }
run
|
edit
|
history
|
help
0
test
Enigme
ok
Game_snake
3
Testing list
Four Digit Number
UFC 271 LIVE STREAM FREE REDDIT online
Only certain spheres.
Random number generator With IF's that sometimes cant count