Run Code | API | Code Wall | Misc | Feedback | Login | Theme | Privacy | Patreon |
Learning Rounding and Truncation from the Maths libraryoriginal number: 23.654586 myFloat.ToString(): 23.65459 (default setting is 5 dec places with rounding) float.ToString("F4"): 23.6546 (has rounding) converting a truncated string of a float, back to a float number float.Parse(float.ToString): 23.655 directly rounding off a float number. must include System.Collections class Math.Round(float,1): 23.7 23 |
λ
.NET NoSQL database for rapid development
|