Possible duplicate:C # - How to round a decimal value to two decimal places (for output on a page)
i has a value of 1.564 and 1.565, I need to round this value to 1.56 and 1.56, which is suitable for this in C #.
To delete less significant digits (1.348 → 1.34):
Math.Floor(number * 100) / 100;
To round a number to two decimal places:
Math.Round(number, 2);
To represent it as a string, to display:
number.ToString("#.00");
multiply by 100, followed by the floor, and then split by a hundred. I'm sure there is a better way to do this, though
Math.floor(n*100)/100
Source: https://habr.com/ru/post/1734372/More articles:java эффективное удаление дубликатов - javaРегулярное выражение для сопоставления строки типа: " + + " - regexIs VisualStudio 2010 built with WPF / XAML? - .netSelect a specific tab in TabActivity from PendingIntent sent from notification - androidClone an object $ this - objectHow to enable the zoom in / out option in UIWebView? - iphonehttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1734374/passing-strings-to-c-functions-with-sas-proc-proto&usg=ALkJrhi8Hb1e-jQLta5x0S77bWyn2QuNiwSpeed: how to analyze / analyze "Directives / Content" stored in a variable? - javaGWT Maven and Eclipse - eclipseHow can I clear this CSS code? making it shorter or removes unnecessary parts (CSS perfectionist needed) - cssAll Articles