ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.Using Round function in C# and VB.Net<p>Dear @amol111,</p> <p>Please refer below articles, it might be help you,</p> <p><a title="http://www.aspforums.net/Threads/111240/Round-to-next-higher-value-if-decimal-value-exists-in-C-Net/" href="http://www.aspforums.net/Threads/111240/Round-to-next-higher-value-if-decimal-value-exists-in-C-Net/" target="_blank">http://www.aspforums.net/Threads/111240/Round-to-next-higher-value-if-decimal-value-exists-in-C-Net/</a></p> <p><a title="http://www.aspforums.net/Threads/129868/How-to-round-to-upper-large-number-in-SQL-Server/" href="http://www.aspforums.net/Threads/129868/How-to-round-to-upper-large-number-in-SQL-Server/" target="_blank">http://www.aspforums.net/Threads/129868/How-to-round-to-upper-large-number-in-SQL-Server/</a></p> <p><a href="https://stackoverflow.com/questions/6857379/how-to-use-the-round-maths-function-in-asp-net">https://stackoverflow.com/questions/6857379/how-to-use-the-round-maths-function-in-asp-net</a></p> <p><a title="https://forums.asp.net/t/1077159.aspx?C+Round+off+Function" href="https://forums.asp.net/t/1077159.aspx?C+Round+off+Function" target="_blank">https://forums.asp.net/t/1077159.aspx?C+Round+off+Function</a></p> <p><a title="https://www.dotnetperls.com/math-round" href="https://www.dotnetperls.com/math-round" target="_blank">https://www.dotnetperls.com/math-round</a></p> <p>&nbsp;</p> <p>&nbsp;<a title="https://anderly.com/2009/07/28/to-round-up-or-to-round-down-that-is-the-question/" href="https://anderly.com/2009/07/28/to-round-up-or-to-round-down-that-is-the-question/" target="_blank">https://anderly.com/2009/07/28/to-round-up-or-to-round-down-that-is-the-question/</a></p>https://www.aspforums.net:443/Threads/101947/Using-Round-function-in-C-and-VBNet/https://www.aspforums.net:443/Threads/101947/Using-Round-function-in-C-and-VBNet/Tue, 26 Dec 2017 23:20:50 GMTUsing Round function in C# and VB.Net<p>&nbsp;</p> <pre class="brush: csharp">Use Math.Round() function to find round value.</pre> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/101947/Using-Round-function-in-C-and-VBNet/https://www.aspforums.net:443/Threads/101947/Using-Round-function-in-C-and-VBNet/Tue, 26 Dec 2017 23:29:27 GMTUsing Round function in C# and VB.Net<p>Refer the below sample code for your reference and implement it as per your code logic.</p> <p><span style="text-decoration: underline;"><strong>C#</strong></span></p> <pre class="brush: csharp">var testValue = 12.10; int result; int number = Convert.ToInt32(testValue.ToString().Split(&#39;.&#39;)[0]); int decimalPointvalue = testValue.ToString().Split(&#39;.&#39;).Length &gt; 1 ? Convert.ToInt32(testValue.ToString().Split(&#39;.&#39;)[1]) &gt; 0 ? Convert.ToInt32(testValue.ToString().Split(&#39;.&#39;)[1]) : 0 : 0; result = number + decimalPointvalue;</pre> <p><span style="text-decoration: underline;"><strong>VB.Net</strong></span> </p> <pre class="brush: vb">Dim testValue = 12.10 Dim result As Integer Dim number As Integer = Convert.ToInt32(testValue.ToString().Split(&#34;.&#34;c)(0)) Dim decimalPointvalue As Integer = If(testValue.ToString().Split(&#34;.&#34;c).Length &gt; 1, If(Convert.ToInt32(testValue.ToString().Split(&#34;.&#34;c)(1)) &gt; 0, Convert.ToInt32(testValue.ToString().Split(&#34;.&#34;c)(1)), 0), 0) result = number + decimalPointvalue</pre> <p><span style="text-decoration: underline;"><strong>Output</strong></span></p> <p>13</p>https://www.aspforums.net:443/Threads/101947/Using-Round-function-in-C-and-VBNet/https://www.aspforums.net:443/Threads/101947/Using-Round-function-in-C-and-VBNet/Tue, 26 Dec 2017 23:48:22 GMT